Create the frame header. Encodes the frame type and optional compression flag, and the size of the payload.
(compressed bool, frameType wsOpCode, l int)
| 554 | // Create the frame header. |
| 555 | // Encodes the frame type and optional compression flag, and the size of the payload. |
| 556 | func 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 | |
| 562 | func wsFillFrameHeader(fh []byte, compressed bool, frameType wsOpCode, l int) (int, []byte) { |
| 563 | var n int |
no test coverage detected