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

Method SetCompressionLevel

conn.go:1217–1223  ·  conn.go::Conn.SetCompressionLevel

SetCompressionLevel sets the flate compression level for subsequent text and binary messages. This function is a noop if compression was not negotiated with the peer. See the compress/flate package for a description of compression levels.

(level int)

Source from the content-addressed store, hash-verified

1215// with the peer. See the compress/flate package for a description of
1216// compression levels.
1217func (c *Conn) SetCompressionLevel(level int) error {
1218 if !isValidCompressionLevel(level) {
1219 return errors.New("websocket: invalid compression level")
1220 }
1221 c.compressionLevel = level
1222 return nil
1223}
1224
1225// FormatCloseMessage formats closeCode and text as a WebSocket close message.
1226// An empty message is returned for code CloseNoStatusReceived.

Callers 2

TestPreparedMessageFunction · 0.80

Calls 1

isValidCompressionLevelFunction · 0.85

Tested by 2

TestPreparedMessageFunction · 0.64