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

Add ping handler support for ping frame. #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrigaya
Copy link

@mrigaya mrigaya commented Mar 6, 2018

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.

@softins
Copy link
Contributor

softins commented Mar 6, 2018

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.

@francisbrosnan
Copy link
Member

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.

@mrigaya
Copy link
Author

mrigaya commented Jun 8, 2018

@francisbrosnan Any suggestion on this pull request?

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

Successfully merging this pull request may close these issues.

4 participants