[Libwebsockets] How to receive message bigger than 4096 bytes on server side?

Nemo 377307289 at qq.com
Thu Nov 5 02:25:22 CET 2015


I have create a websocket server with libwebsockets library, and the protocol list is like this:
/* List of supported protocols and callbacks. */ static struct libwebsocket_protocols protocols[] = {     { "plain-websocket-protocol" /* Custom name. */,       callback_websocket,       sizeof(struct websocket_client_real),       0 },     { NULL, NULL, 0, 0 } /* Terminator. */ }; 



When I use "html + javascript + chrumium browser" as client to send websocket message bigger than 4096 bytes, the websocket server will receive the LWS_CALLBACK_RECEIVE callback more than one time, one message is splited to two or more, and the max receive size is 4096.

How can I receive unlimited size websocket message on server side?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20151105/5af1dad7/attachment.html>


More information about the Libwebsockets mailing list