websocket-sharp icon indicating copy to clipboard operation
websocket-sharp copied to clipboard

How to send Pong?

Open Zeddex opened this issue 2 years ago • 1 comments

When I get ping I need to send back pong. But I can't find any possibility to do this.

private void OnMessage(object sender, MessageEventArgs e) { if (e.IsPing) { _ws.Send(Opcode.Pong); // or something like that } }

Zeddex avatar Jan 12 '23 15:01 Zeddex

There is internal function WebSocketFrame.CreatePongFrame If I understood correctly, the pong response will be sent automatically.

apdevelop avatar Jan 12 '23 15:01 apdevelop