json_rpc_2
json_rpc_2 copied to clipboard
The caller should be able to override the id value
The JSON-RPC transport agnostic. The current implementation uses an auto-increment number (which always starts from zero) as the id value. This is appropriate for a point-to-point type transport (e.g. socket based protocols), but for MQTT, for example, this could potentially cause problems when the server replies are received by all clients, and clients start sending requests at the same time but with different parameters (but with same id started from zero). JSON-RPC states that the id can be of string type. If clients were able to choose a unique string value specific to them as the id value, it could be safely used with MQTT in all cases.