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

Sagaert Johan sagaert.johan at skynet.be
Wed Jul 29 12:02:40 CEST 2015


 
 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





More information about the Libwebsockets mailing list