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)
| 1183 | // reader Read methods. The application must read the connection to process |
| 1184 | // pong messages as described in the section on Control Messages above. |
| 1185 | func (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 |
no outgoing calls