-
Notifications
You must be signed in to change notification settings - Fork 284
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
Need Example WebSocket ping #2802
Comments
A simple ping can be sent like this: ws.send((msg) { msg.write([]); }, FrameOpcode.ping); This will send a ping message and should trigger a matching pong on the remote side. However, it will not count as a regular ping/pong within vibe.d's logic, so all it does is generate some network activity. Do you know what exactly goes wrong on the connection? Are no pings generated at all by the server? |
It looks like some websocket servers expect the client to start pinging before sending an pong back, if the client does not send a ping the connection will get dropped. What is msg in your example? |
Okay, sounds like this should work then, no idea whether the server expects any actual payload in the ping message. Maybe it also makes sense to add a new field
|
Adding HTTPClientSettings.webSocketPingInterval for the client would indeed solve these issues. |
Does not work for me, could you show me a working example?
|
Cross-posting from forum: https://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/279955/#post-279961 |
Hello,
Some websockets are not compliant and we need to be able to sendPings once in a while manually.
Please show an example on how to do this for a connectWebSocket (Client) stream.
Thank you.
The text was updated successfully, but these errors were encountered: