[Libwebsockets] lwsts[14029]: ****** c4f0e0 Sending new, pending truncated ... ??

Srikar Vadlamani SrikarVadlamani at trafficware.com
Fri Jul 31 16:03:04 CEST 2015

Look at callback_lws_mirror in http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/tree/test-server/test-server.c


From: Brice Hamon [mailto:andy.green at linaro.org]
Sent: Friday, July 31, 2015 7:14 AM
To: Sagaert Johan <andy.green at linaro.org>
Cc: libwebsockets at ml.libwebsockets. <libwebsockets at ml.libwebsockets.org>
Subject: Re: [Libwebsockets] lwsts[14029]: ****** c4f0e0 Sending new, pending truncated ... ??

As Fabian said, check the test-server.c.

You have to pad your buffer, handle the return of the write to check if successful and check if you can write more with lws_send_pipe_choked.

On Wed, Jul 29, 2015 at 6:02 AM, Sagaert Johan <andy.green at linaro.org<mailto:andy.green at linaro.org>> wrote:

 Hi ;

I have a problem in my libwebsockets app.


  char texttosend[255];

  // get (JSON) strings to sent from a fifo queue
     printf("Sending TO HTML: [%s]\n",texttosend);
     n = libwebsocket_write(wsi, (unsigned char *) texttosend,strlen(texttosend), LWS_WRITE_TEXT);


I suspect I am trying to sent to much data at once.
What is the solution to this ?
Should I only get 1 or a limited number of items from the queue at once and then call the
if my fifo is not empty ?
Any other options to deal with this?

/* output from the console
Sending TO HTML: [{"analog":{"address":8,"value":"255"}}]
Sending TO HTML: [{"relay":{"address":0,"value":"0"}}]
Sending TO HTML: [{"relay":{"address":5,"value":"0"}}]
Sending TO HTML: [{"relay":{"address":17,"value":"0"}}]
Sending TO HTML: [{"relay":{"address":19,"value":"0"}}]
Sending TO HTML: [{"relay":{"address":20,"value":"0"}}]
lwsts[14029]: ****** c4f0e0 Sending new, pending truncated ...

Sagaert Johan

Libwebsockets mailing list
Libwebsockets at ml.libwebsockets.org<mailto:Libwebsockets at ml.libwebsockets.org>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20150731/fba8a6fa/attachment-0001.html>

More information about the Libwebsockets mailing list