SetReadLimit sets the maximum size in bytes for a message read from the peer. If a message exceeds the limit, the connection sends a close message to the peer and returns ErrReadLimit to the application.
(limit int64)
| 1110 | // message exceeds the limit, the connection sends a close message to the peer |
| 1111 | // and returns ErrReadLimit to the application. |
| 1112 | func (c *Conn) SetReadLimit(limit int64) { |
| 1113 | c.readLimit = limit |
| 1114 | } |
| 1115 | |
| 1116 | // CloseHandler returns the current close handler |
| 1117 | func (c *Conn) CloseHandler() func(code int, text string) error { |
no outgoing calls