Hacker News new | ask | show | jobs
by simpsond 5287 days 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.

1 comments

But we're talking about messages, not frames. 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