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

Brice Hamon brice at ydotm.com
Fri Jul 31 14:14:18 CEST 2015


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>
wrote:

>
>  Hi ;
>
> I have a problem in my libwebsockets app.
>
> In my callback case LWS_CALLBACK_SERVER_WRITEABLE:
>
> {
>   char texttosend[255];
>
>   // get (JSON) strings to sent from a fifo queue
>   while(getqueued_item(per_sessie_data->phtml5websocket_client,texttosend))
>   {
>      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
> libwebsocket_callback_on_writable_all_protocol()
> 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
> http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20150731/e4809c71/attachment-0001.html>


More information about the Libwebsockets mailing list