4 ms·
Well, all frames actually do have length in the header. It's just not the first byte... it's the lowest 7 bits of the second byte, and possibly more (check the
by simpsond 15y ago
Well, all frames actually do have length in the header. It's just not the first byte... it's the lowest 7 bits of the second byte, and possibly more (check the spec).
So, if I can read 2 bytes from my buffer, I can get a good idea of the message size. If I only have 1 byte, I rewind and wait until I receive another.
- marshray 15y agoBut we're talking about messages, not frames. http://tools.ietf.org/html/rfc6455 http://tools.ietf.org/html/rfc6455 "frames have no semantic meaning" If Websocket developers begin making unwarranted assumptions about message framing and fragmentation you will regret it. BELIEVE ME. /me gets back to bugfixing