MCPcopy
hub / github.com/gorilla/websocket / SetPongHandler

Method SetPongHandler

conn.go:1185–1190  ·  view source on GitHub ↗

SetPongHandler sets the handler for pong messages received from the peer. The appData argument to h is the PONG message application data. The default pong handler does nothing. The handler function is called from the NextReader, ReadMessage and message reader Read methods. The application must read

(h func(appData string) error)

Source from the content-addressed store, hash-verified

1183// reader Read methods. The application must read the connection to process
1184// pong messages as described in the section on Control Messages above.
1185func (c *Conn) SetPongHandler(h func(appData string) error) {
1186 if h == nil {
1187 h = func(string) error { return nil }
1188 }
1189 c.handlePong = h
1190}
1191
1192// NetConn returns the underlying connection that is wrapped by c.
1193// Note that writing to or reading from this connection directly will corrupt the

Callers 5

newConnFunction · 0.95
TestControlFunction · 0.80
pumpStdinFunction · 0.80
readPumpMethod · 0.80
readerFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestControlFunction · 0.64