[Libwebsockets] WebSocket messages: when are they atomic?

Daniel Griscom griscom at suitable.com
Tue May 7 02:57:56 CEST 2013


I'm getting up to speed on libwebsockets and WebSockets, to be used 
for communication between a browser and the web host (vanilla 
installation: no extensions). I'm designing the protocol which will 
be used across the WebSocket, and it would be great if the messages 
sent back and forth were atomic.

I see that the struct libwebsocket_protocols has a rx_buffer_size; if 
I set this to the largest message that will be sent by a client then 
will each client message arrive in a single callback?

And, in the other direction, how will libwebsocket_write() handle 
large messages? Can I make sure that messages below some size limit 
will arrive in a single JavaScript onmessage call?


Thanks,
Dan

-- 
Daniel T. Griscom             griscom at suitable.com
Suitable Systems              http://www.suitable.com/
1 Centre Street, Suite 204    (781) 665-0053
Wakefield, MA  01880-2400



More information about the Libwebsockets mailing list