Skip to content
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

id incrementation and resetId() #191

Open
requinham opened this issue Mar 1, 2017 · 5 comments
Open

id incrementation and resetId() #191

requinham opened this issue Mar 1, 2017 · 5 comments
Milestone

Comments

@requinham
Copy link

Hi,

I'm wrinting to you to inquire about the "id" management in RpcProtocolClient class.
The comment mention that : "The id starts at 1 and is incremented for each request. To reset this value to one, call the jsonrpc::RpcProRpcProtocolClient::resetId() method."
But no incrementation is done in this class and no resetId() method is provided !!

Can someone clarify this please, is ther because the requesting is synchronous or it's not coded yet ?
Thanks in advance.

/Mohamed

@cinemast
Copy link
Owner

cinemast commented Mar 2, 2017

Actually both. The increment implementation is missing, i will fix that. Thank you for mentioning this.
On the other hand, because there are currently only synchronous communication methods this is not a problem right now.

@requinham
Copy link
Author

I think it is a problem also for synchronous multithreaded clients. I think the server can receive two or more requests with the same identifier !
My suggestion is that the id need to be unique and "incremented"/"changed randomly" for all requests (batch mode or simple mode) for the same client process to avoid strange behavior.

Regards,
/Mohamed

@cinemast
Copy link
Owner

Well that is true, nevertheless it is still not a problem because all servers are currently working connection oriented, so for each client there is a separate socket. So there is no way to mix up requests with responses.

@cinemast cinemast added this to the 1.0.0 milestone Aug 24, 2017
@requinham
Copy link
Author

requinham commented Aug 24, 2017

I'm think it was a confusion of interpretation of JSONRPC protocol.
JSONRPC is an applicative protocol and client at this level don't needs to have a separate TCP (Transport connection). For my case I have implements new Connector based on MQTT protocol and I have many JSONRPC threaded clients shares the same instance of connector which use only one TLS/TCP/IP connection with the broker...

I can tell you other example about this but the main idea is that many JSONRPC clients is not always imply many TCP connection...

@cinemast cinemast modified the milestones: 1.0.1, 1.0.0 Aug 28, 2017
@cinemast
Copy link
Owner

@requinham could you share your implementation of the MQTT connector?

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

No branches or pull requests

2 participants