[Libwebsockets] Hello andy or anyone i am in need of help.

Genusis Andrew . lordsatin at hotmail.com
Tue Jan 27 20:19:46 CET 2015



I managed to fix the error by doing.

struct per_session_data {
    unsigned char buf[LWS_SEND_BUFFER_PRE_PADDING + 4096 +
        LWS_SEND_BUFFER_POST_PADDING];
    unsigned int len;
};

pss->len = sprintf((char *)&pss->buf[
                    LWS_SEND_BUFFER_PRE_PADDING], "%s", data);
                n = libwebsocket_write(wsi, &pss->buf[
                    LWS_SEND_BUFFER_PRE_PADDING], pss->len, LWS_WRITE_TEXT);

Now it sends the data properly.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20150127/53fbf0c4/attachment-0001.html>


More information about the Libwebsockets mailing list