MCPcopy
hub / github.com/nats-io/nats.go / maxFrameSize

Method maxFrameSize

ws.go:190–198  ·  view source on GitHub ↗

maxFrameSize returns the maximum allowed WebSocket frame size based on the negotiated MaxPayload. This mirrors the server-side wsMaxMessageSize logic.

()

Source from the content-addressed store, hash-verified

188// maxFrameSize returns the maximum allowed WebSocket frame size based on the
189// negotiated MaxPayload. This mirrors the server-side wsMaxMessageSize logic.
190func (r *websocketReader) maxFrameSize() uint64 {
191 if r.nc != nil {
192 mp := r.nc.info.MaxPayload
193 if mp > 0 && uint64(mp) <= wsMaxMsgPayloadLimit/wsMaxMsgPayloadMultiple {
194 return uint64(mp) * wsMaxMsgPayloadMultiple
195 }
196 }
197 return wsMaxMsgPayloadLimit
198}
199
200// From now on, reads will be from the readLoop and we will need to
201// acquire the connection lock should we have to send/write a control

Callers 1

ReadMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected