When an "onmessage" event fires in the web socket protocol are you guaranteed the full message or is it more like a straight TCP connection where you buffer the data first and then try to extract packets.
Asked
Active
Viewed 275 times
2
-
This comes to mind http://www.lenholgate.com/blog/2011/07/websockets-is-a-stream-not-a-message-based-protocol.html – dan_waterworth Jan 11 '12 at 17:45
1 Answers
2
There is protocol level support for fragmented messages and streaming. But this behavior is not represented in the current Javascript API, (reference). So yes, if you receive a message, it is indeed an entire message even if it was sent as many fragments.

dan_waterworth
- 6,261
- 1
- 30
- 41