News for hackers. Stuff that matters.
Re:WebSockets is a stream, not a message based protocol by simpsond on Wednesday December 21, 2011 @02:25PM (#3378732)
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.

Re:WebSockets is a stream, not a message based protocol by marshray on Wednesday December 21, 2011 @02:36PM (#3378777)
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