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 unsolicited pong support #15

Closed
wants to merge 1 commit into from
Closed

Conversation

glukacsy
Copy link

Hi,

I added unsolicited pong support to Casablanca (see https://tools.ietf.org/html/rfc6455#section-5.5.3). This is useful for cases when the client wants to check whether the websocket connection is still up and running. For example, if I unplug my network cable, without this change, Casablanca simply does not notice that the Websocket connection is down, the close handler won't get invoked etc.

With these changes, the client can send (periodically or when certain events happen, e.g. network change events) an unsolicited pong request which has no effect on a healthy websocket connection, but will help Casablanca/WebSocket++ detect that the connection has been lost. With these changes, if I unplug my network cable and if I send a pong message after that, Casablanca correctly invokes the websocket close handler within a few seconds.

Regards,
Gergely

@msftclas
Copy link

Hi @glukacsy, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@msftclas
Copy link

@glukacsy, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, MSBOT;

@kavyako
Copy link
Contributor

kavyako commented Nov 12, 2015

hey Gergely

For any changes, especially that add new public APIs, we would really appreciate sufficient test coverage.
The websockets tests are under cpprestsdk / Release / tests / functional / websockets / client /
Could you please take a look at adding a test if possible?

Let me know if you have any concerns here.

Thanks
Kavya

@glukacsy
Copy link
Author

Hi, no problem at all, I will add tests ASAP (I should have done it with the original pull request).

Thanks,
Gergely

@glukacsy
Copy link
Author

Hi, I added a new pull request which is the same as this + integration tests. I guess we can close this one?

Regards,
Gergely

@kavyako
Copy link
Contributor

kavyako commented Nov 23, 2015

Closing this PR.
Now being tracked under #20

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