-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JSON-RPC access to directories and server lists (without connect/disconnect methods) #3479
base: main
Are you sure you want to change the base?
Conversation
Squash from: jamulussoftware#3249 rpc_notification jamulusclient/serverListReceived rpc_method jamulus/pollServerList Change JSON-RPC for server list. Use pollServerList instead of getServerList. (No result returned from the call.) Change "address" to "url" Adds documentation for new JSON-RPC methods Consistent use of countryId Fixes JSON-RPC docs JSON-RPC fixes for feedback to PR Changes method "jamulus/pollServerList" to "jamulusclient/pollServerList" (for consistency). Changes "url" to "address" in protocol and "server address" in docs. Fixes typo in countryId. JSON-RPC Enhancements Adds jamulusclient/connect method. Adds jamulusclient/disconnect method. Adds jamulusclient/serverInfoReceived notification. Return country string rather than (QT specific) country code. Request server info after server list received (to get each server's ping time and num clients). JSON-RPC enhancements Adds method jamulusclient/recorderState. Changes intrument code to instrument name (remote client may not have access to lookup table). Fixes errors in docs. Fixes coding style Update docs Fix coding style
d830548
to
324c588
Compare
These methods unfortunately break the GUI if called
324c588
to
3c89fe5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a number of suggestions.
Co-authored-by: Tony Mountifield <[email protected]>
docs/JSON-RPC.md
Outdated
@@ -129,6 +129,23 @@ Results: | |||
| result.version | string | The Jamulus version. | | |||
|
|||
|
|||
### jamulus/pollServerList | |||
|
|||
Request list of servers in a directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Request list of servers in a directory | |
Request list of servers in a directory. |
@@ -129,6 +129,23 @@ Results: | |||
| result.version | string | The Jamulus version. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency on a page is a mercy for readers, and this page consistently puts a period behind non-sentences. Ideally, none would include a period.
docs/JSON-RPC.md
Outdated
|
||
| Name | Type | Description | | ||
| --- | --- | --- | | ||
| params.directory | string | socket address of directory to query, e.g. anygenre1.jamulus.io:22124. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| params.directory | string | socket address of directory to query, e.g. anygenre1.jamulus.io:22124. | | |
| params.directory | string | Socket address of directory to query. Example: anygenre1.jamulus.io:22124. | |
e.g. is not used elsewhere on this page. Perhaps it could be avoided here.
docs/JSON-RPC.md
Outdated
|
||
| Name | Type | Description | | ||
| --- | --- | --- | | ||
| params.state | number | The recorder state | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| params.state | number | The recorder state | | |
| params.state | number | The recorder state. | |
I hate this fix, but it's consistent with the rest of the page.
docs/JSON-RPC.md
Outdated
|
||
| Name | Type | Description | | ||
| --- | --- | --- | | ||
| params.address | string | The server socket address | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| params.address | string | The server socket address | | |
| params.address | string | The server socket address. | |
docs/JSON-RPC.md
Outdated
| Name | Type | Description | | ||
| --- | --- | --- | | ||
| params.address | string | The server socket address | | ||
| params.pingtime | number | The round-trip ping time in ms | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| params.pingtime | number | The round-trip ping time in ms | | |
| params.pingtime | number | The round-trip ping time, in milliseconds. | |
docs/JSON-RPC.md
Outdated
| --- | --- | --- | | ||
| params.address | string | The server socket address | | ||
| params.pingtime | number | The round-trip ping time in ms | | ||
| params.numClients | number | The quantity of clients connected to the server | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| params.numClients | number | The quantity of clients connected to the server | | |
| params.numClients | number | The number of clients connected to the server. | |
Perhaps there's a notion that the definition of something shouldn't use the same word. Maybe. But the only existing similar usage on this page is result.clients[*].channels, and it says number rather than quantity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(And the aim is to contextualise "number of clients" rather than explain "number", "of" or "clients".)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry! I tend to use the word, "quantity" in docs to avoid ambiguity. Feel free to use the language with which you feel most comfortable.
docs/JSON-RPC.md
Outdated
| Name | Type | Description | | ||
| --- | --- | --- | | ||
| params.servers | array | The server list. | | ||
| params.servers[*].address | string | Socket address (ip_address:port) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| params.servers[*].address | string | Socket address (ip_address:port) | | |
| params.servers[*].address | string | Socket address (ip_address:port). | |
docs/JSON-RPC.md
Outdated
| --- | --- | --- | | ||
| params.servers | array | The server list. | | ||
| params.servers[*].address | string | Socket address (ip_address:port) | | ||
| params.servers[*].name | string | Server name | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| params.servers[*].name | string | Server name | | |
| params.servers[*].name | string | Server name. | |
docs/JSON-RPC.md
Outdated
| params.servers[*].address | string | Socket address (ip_address:port) | | ||
| params.servers[*].name | string | Server name | | ||
| params.servers[*].countryId | number | Server country ID (see QLocale::Country). | | ||
| params.servers[*].country | string | Server country | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| params.servers[*].country | string | Server country | | |
| params.servers[*].country | string | Server country. | |
Co-authored-by: mcfnord <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcfnord applied. Thanks. I agree the "." change looks strange.
@@ -286,6 +286,8 @@ class CClient : public QObject | |||
Channel.GetBufErrorRates ( vecErrRates, dLimit, dMaxUpLimit ); | |||
} | |||
|
|||
CProtocol* getConnLessProtocol() { return &ConnLessProtocol; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. pClient
gets passed to ClientRpc
, which isn't a problem for threading. That should make calls to pClient->anything()
thread-safe, right?
I'd just be more comfortable not to dig around inside pClient to the internals -- if pClient should expose a change, it should have its own slot exposing that and signal it itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short description of changes
Modified version of: #3249
Quoting the initial PR:
CHANGELOG: Added jamulusclient/pollServerList methods and jamulusclient/receivedServerList notification to JSON-RPC interface.
Context: Fixes an issue?
Does this change need documentation? What needs to be documented and how?
Status of this Pull Request
To be tested.
What is missing until this pull request can be merged?
Checklist