Open mrigaya opened 6 years ago
It would be useful also to call conn->on_ping_msg
before sending the pong when there is no payload, in case the application just needs to know that a ping was received, but there is no need for data. Around line 3458.
Dear @mrigaya Thanks for your time and the patch. The idea looks good to me. @softins's idea too. I'll review all this asap. Best Regards.
@francisbrosnan Any suggestion on this pull request?
As per https://tools.ietf.org/html/rfc6455#section-5.5.2 definition, A Ping frame MAY include "Application data".
In nopoll when PING frame is recieved with payload, it responds with PONG frame having same payload. In case if the user/client is interested in the payload/application data it received with PING, then there is no option for the client to get that payload.
If we have ping handler similar to msg handler then it will be useful/easier for the client to get that payload. And based on the ping handler, client can set the timer in their application to detect any timeout or pings not received over the connection for certain amount of time due to some network issue, then client can close the connection completely and retry again with new server.
Review these changes and Please let me know if it requires any modification/suggestion from your end.