3
I built a server to implement the Websocket HTML5. In this implementation, I always send and receive data in the format JSON
.
But I have the following question: There is a limit size to be passed in the method Websocket.send?
3
I built a server to implement the Websocket HTML5. In this implementation, I always send and receive data in the format JSON
.
But I have the following question: There is a limit size to be passed in the method Websocket.send?
8
A single Websocket frame, per RFC-6455 base frame, has a maximum size limit of 2 63 bytes (9,223,372,036,854,775,807 bytes ~ = 9,22 exabytes)
However, a Websocket message, composed of 1 or more frames, has no limit imposed from the protocol level.
Each Websocket implementation will treat message and frame boundaries differently. How to set maximum message sizes for the entire message (usually for memory consumption reasons) or offer streaming options for large messages to better utilize memory.
But in your case, it is likely that the chosen Websocket implementation has a bug and is improperly dividing the JSON message into multiple messages, rather than multiple frames. You can use the network inspection tool in Chrome or an external tool like Wireshark to confirm this behavior.
I hope I’ve helped
Browser other questions tagged javascript websocket
You are not signed in. Login or sign up in order to post.