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

Function wsCreateFrameHeader

ws.go:556–560  ·  view source on GitHub ↗

Create the frame header. Encodes the frame type and optional compression flag, and the size of the payload.

(compressed bool, frameType wsOpCode, l int)

Source from the content-addressed store, hash-verified

554// Create the frame header.
555// Encodes the frame type and optional compression flag, and the size of the payload.
556func wsCreateFrameHeader(compressed bool, frameType wsOpCode, l int) ([]byte, []byte) {
557 fh := make([]byte, wsMaxFrameHeaderSize)
558 n, key := wsFillFrameHeader(fh, compressed, frameType, l)
559 return fh[:n], key
560}
561
562func wsFillFrameHeader(fh []byte, compressed bool, frameType wsOpCode, l int) (int, []byte) {
563 var n int

Callers 2

WriteMethod · 0.85
wsEnqueueControlMsgMethod · 0.85

Calls 1

wsFillFrameHeaderFunction · 0.85

Tested by

no test coverage detected