WritePong writes a pong message to the writer
(w io.Writer, nonce uint64)
| 31 | |
| 32 | // WritePong writes a pong message to the writer |
| 33 | func WritePong(w io.Writer, nonce uint64) error { |
| 34 | if err := writeByte(w, OpPong); err != nil { |
| 35 | return fmt.Errorf("failed to write pong opcode: %w", err) |
| 36 | } |
| 37 | if err := writeUint64(w, nonce); err != nil { |
| 38 | return fmt.Errorf("failed to write pong nonce: %w", err) |
| 39 | } |
| 40 | return nil |
| 41 | } |
| 42 | |
| 43 | // WriteShutdown writes a shutdown message to the writer |
| 44 | func WriteShutdown(w io.Writer) error { |