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

Method SetReadLimit

conn.go:1112–1114  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1110// message exceeds the limit, the connection sends a close message to the peer
1111// and returns ErrReadLimit to the application.
1112func (c *Conn) SetReadLimit(limit int64) {
1113 c.readLimit = limit
1114}
1115
1116// CloseHandler returns the current close handler
1117func (c *Conn) CloseHandler() func(code int, text string) error {

Callers 4

TestReadLimitFunction · 0.80
pumpStdinFunction · 0.80
readPumpMethod · 0.80
readerFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestReadLimitFunction · 0.64