-
Notifications
You must be signed in to change notification settings - Fork 301
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
support set ping handler and pong handler #307
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just like i want to count the number of ping,or set close the connection if there is no ping message whithin two cycle. |
@nhooyr I need pings/pongs at the application layer for an app we're building a replacement for. I know work is being done on the Could this PR be merged? |
@schmidtw Sorry I won't get to this for a few weeks still. There's another change I wanted to make to let people handle close frames too. What feature are you trying to ship that relies on this? |
I have a protocol that depends on sending & receiving websocket pings and pongs. Each side of the connection expect a ping/pong within an interval & if either doesn't get the ping or pong from the other side the connection is determined to be broken & application logic notes the reason, closes down immediately & the client side will reconnect. The pings and pongs are reported as metrics as well. This is the project: https://xmidt.io/ Since this is weeks out & behind other PRs and the |
Makes sense. Yes, please fork the code for now. |
first of all, thanks this good project, we are preparing a tool based on this project.
Sometimes i need do something while receive ping or pong message.
So I added this feature, is it alright