PING/PONG Message Actions
After the 2.0 update the server now apparently sends "ping" messages to the client which look like C|PI and which occur after theA|A|+ login event. I don't see this message documented here:
https://deepstream.io/info/protocol/all-messages/
I'm maintaining my own C# client and wondering if I need to support these messages by responding somehow. If I look in the 2.0 deepstream.io-client-js constants I see there's a 'pong' action. How should clients handled these pings?
The js client seems to handle the request with a pong:
if( message.action === C.ACTIONS.PING ) {
this._lastHeartBeat = Date.now();
this._submit( messageBuilder.getMsg( C.TOPIC.CONNECTION, C.ACTIONS.PONG ) );
}
~If I do nothing and ignore the ping, subsequent request to the deepstream server appear to be received (i.e. RPC endpoints are called), however no response is passed on to the client.~
EDIT: the missing response was unrelated, but I am still curious if pings need to be handled in 2.0 clients.
Hey, this has actually just been added to 2.0. Just deploying a new release of our website with the missing specs.
You have to support ping/pong messages since if you don't respond the server will assume your client is dead.
In the JS client we also assume if we miss two ping events from the server the connection is then not really valid and so you would disconnect and connect again.
Interesting to hear about your C# client! We are planning on having a community page with links to all the clients out there, let me know if you would like urs to be added!
Closing issue, hope it answered your question!