Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximal size for SockJS messages?

I'm using Vert.x and SockJS to transfer data encapsulated in messages. Is there a specification how big the SockJS/Websocket messages can be?

like image 901
phil Avatar asked Nov 26 '12 18:11

phil


1 Answers

There isn't an explicit limit of a size of a SockJS message. But unfortunately SockJS is quite fragile and should not be used to send huge data. In ideal world you'd send control messages (latency-sensitive) over SockJS and big payloads (for throughput) using external methods - for example using an AJAX call.

On technical side you should be able to push pretty much anything over websockets transport, but on streaming and polling ones you need to be more careful. Specifically, a polling requests must be reestablished within 5 seconds, and it may be tough when all the bandwidth is occupied by sending data from the browser to the server. So, uploading large blobs is not recommended with sockjs.

like image 135
Marek Avatar answered Oct 03 '22 01:10

Marek