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

Function WritePing

pkg/shared/control.go:22–30  ·  view source on GitHub ↗

WritePing writes a ping message to the writer

(w io.Writer, nonce uint64)

Source from the content-addressed store, hash-verified

20
21// WritePing writes a ping message to the writer
22func WritePing(w io.Writer, nonce uint64) error {
23 if err := writeByte(w, OpPing); err != nil {
24 return fmt.Errorf("failed to write ping opcode: %w", err)
25 }
26 if err := writeUint64(w, nonce); err != nil {
27 return fmt.Errorf("failed to write ping nonce: %w", err)
28 }
29 return nil
30}
31
32// WritePong writes a pong message to the writer
33func WritePong(w io.Writer, nonce uint64) error {

Callers 2

startHealthCheckMethod · 0.92
TestPingPongRoundTripFunction · 0.85

Calls 2

writeByteFunction · 0.85
writeUint64Function · 0.85

Tested by 1

TestPingPongRoundTripFunction · 0.68