Skip to content

Connect disconnect#3813

Open
digable1 wants to merge 3 commits into
jamulussoftware:mainfrom
digable1:connect-disconnect
Open

Connect disconnect#3813
digable1 wants to merge 3 commits into
jamulussoftware:mainfrom
digable1:connect-disconnect

Conversation

@digable1

Copy link
Copy Markdown

**Add new connect/disconnect JSON-RPC API methods and a Id attribute to getChannelInfo result collection **

CHANGELOG:

Add new JSON-RPC API methods and channel info attribute. This includes re-factoring to share the connect and disconnect processing between the Jamulus client and the JSON-RPC API calls.

Context: Fixes an issue?

This is take 2 of an original submission of a closed issue, #3783. Reasons for this re-submission:

  1. This issue was possibly never addressed, due to issues with the PR submission.
  2. There was another API call included in the original submission, no separate into its own PR: getCurrentDirectory. It was recommended that I separate this call because these calls are substantial (I kept the attribute addition due to this being trivial and easy to check during reviews).

An attempt was made to fix the original PR submission issues, and link to that work was provided there. But as commented on that PR "I am a bit concerned about the message "This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository." that is displayed in that commit. I had not seen that before, and while I know it's not nefarious, the results from a search for that string suggested it (looks like it really is missing an original source for that commit?)". So there is confusion about whether that work actually still part of the PR pipeline, especially since that issue is now closed. I also took this opportunity to resolve the submission issues that caused this extra work to be done, so this one should be clean.

Does this change need documentation? What needs to be documented and how?

The documentation JSON-RPC.md has been updated (as you know, there's a tool for automating this).

Status of this Pull Request

What is missing until this pull request can be merged?

Checklist

  • [x ] I've verified that this Pull Request follows the general code principles
  • [ x] I tested my code and it does what I want
  • [x ] My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • [x ] I've filled all the content above

digable1 added 3 commits July 15, 2026 13:57
Adds two client JSON-RPC methods:
- jamulusclient/connect(directory, server): validates the server is (still)
  listed under the given directory's last polled server list, then attempts
  the connection, returning "ok" or a loose classification of why not
  ("Not Found", "Unauthorized", "Gone (server no longer listed)", "Upgrade
  Required (obsolete protocol, upgrade Jamulus)", "Insufficient Storage
  (Full)").
- jamulusclient/disconnect(directory, server): tears down the connection
  established by jamulusclient/connect, validating the params identify the
  current connection.

Also includes jamulusclient/getDirectories, needed by jamulusclient/connect's
callers to discover directory socket addresses in the first place.
(jamulusclient/getCurrentDirectory and jamulusclient/setCurrentDirectory are
left out of this branch for a separate, focused review.)

Both connect/disconnect share their core logic with the desktop UI's
Connect/Disconnect button instead of duplicating it:
- CClient::ConnectToServer() is a new method used by both CClientDlg::Connect
  and jamulusclient/connect to attempt a connection and classify the outcome.
- CClient::Stop() now reliably emits Disconnected() regardless of caller, and
  CClientDlg::OnDisconnected()/OnClientIDReceived() (rather than Connect()/
  Disconnect() themselves) own the GUI sync, so the desktop UI stays correct
  whether the connection was started/stopped via the UI or via the API.
- CClient::GetServerAddress() and GetMyChannelID() are new small accessors
  needed to let the UI show a sensible default server name/channel ID
  regardless of which path connected. GetMyChannelID() also fills in
  jamulusclient/getChannelInfo's result.id, previously a TODO because
  CChannelCoreInfo lacks that field.
@digable1
digable1 marked this pull request as ready for review July 20, 2026 18:13
@ann0see

ann0see commented Jul 20, 2026

Copy link
Copy Markdown
Member

Thank you! I think you should have a look at #3806 since this PR depends on a requested redesign I believe we’re going with the approach by @mcfnord

@ann0see

ann0see commented Jul 20, 2026

Copy link
Copy Markdown
Member

But yes, your approach probably is also worth combining into his codebase but this definitely needs discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants