-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Source documentation #4
Comments
Yes, that would be nice. :) Seriously, I'm finding it hard to figure out how to use the |
I did get the right insight. The following javascript code illustrates one RPC:
The required name mapping here is {"game"}. If the |
Here is a little bit of sample code at least: https://github.com/jsonrpcx/json-rpc-cxx/blob/master/examples/warehouse/main.cpp |
I am not sure what you mean with the JavaScript example. |
My apologies -- I didn't see your response, and since I had figured out how it worked, I had no need to come back to check for an answer. The JavaScript shows how my client side |
Hi there, just stated using the library a few days ago. Took me a bit of reading the source code to get it woking.
So i thought i would make an example that covers most of the use case that I have. Though in my case I am only using the server part not the client code.
Thought something like this might be useful to have somewhere as a smaller example. As the warehouse example is a bit more complex. |
One other thing that I wanted to mention is in regards to the following code in server.hpp [98 - 110].
So I had problems when I provided the wrong parameters to a notification. As the above code would catch and return nothing. This meant the message would be sent and no errors happened, but not code was executed. Which was very confusing. So my first instinct was to look at my own code rather then checking the json file. I then read through the implementation to find this. And then implemented Notification as a method instead, and was the able to figure out the error. Not sure it would be possible to add a return json or not, but documentation would definitely help. |
Thank you for documenting the usage issues that you found. Regarding the notifications, they should not return anything by definition of the JSON-RPC 2.0 specification. Also in case of errors.
|
No description provided.
The text was updated successfully, but these errors were encountered: