MCPcopy Create free account
hub / github.com/dan-v/lambda-nat-proxy / WritePong

Function WritePong

pkg/shared/control.go:33–41  ·  view source on GitHub ↗

WritePong writes a pong message to the writer

(w io.Writer, nonce uint64)

Source from the content-addressed store, hash-verified

31
32// WritePong writes a pong message to the writer
33func 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
44func WriteShutdown(w io.Writer) error {

Callers 2

handleControlStreamFunction · 0.92
TestPongMessageFunction · 0.85

Calls 2

writeByteFunction · 0.85
writeUint64Function · 0.85

Tested by 1

TestPongMessageFunction · 0.68