[Libwebsockets] Reading incoming data NOT in callback

David Haykazyan david.haykazyan at onetick.com
Fri May 16 07:25:48 CEST 2014


Hi,

My server serves multiple clients simultaneously and for the best
performance I need to communicate with each client in a separate thread.
Writing seems to be straightforward, libwebsocket_write method works (even
though its thread safety is yet to be tested). But what to do with reading?
I've tried libwebsocket_read - doesn't work (returns 0 and does not fill
the buffer). I've even tried not to call libwebsocket_service, but
libwebsocket_read still does not give me data. The data is definitely
there, as soon as I call libwebsocket_service, it calls my callback with
LWS_CALLBACK_RECEIVE reason.

Any help is much appreciated.

Best regards,
David.

-- 

------------------------------

*CONFIDENTIALITY NOTE:* THIS E-MAIL MESSAGE AND ANY ATTACHMENTS MAY CONTAIN 
CONFIDENTIAL AND PRIVILEGED INFORMATION OF ONEMARKETDATA, LLC.  IT IS FOR 
THE SOLE USE OF THE INTENDED RECIPIENT(S) AND ANY UNAUTHORIZED REVIEW, USE, 
COPYING OR DISCLOSURE IS PROHIBITED. IF YOU ARE NOT THE INTENDED RECIPIENT, 
PLEASE CONTACT THE SENDER IMMEDIATELY BY REPLY E-MAIL OR BY TELEPHONE AT +1 
201 710 5977, AND DESTROY ALL COPIES OF THIS MESSAGE FROM YOUR SYSTEM.

E-SIGNATURE NOTICE: Unless specifically set forth herein, the transmission 
of this communication is not intended to be a legally binding electronic 
signature, and no offer, commitment or assent on behalf of OneMarketData, 
LLC is expressed or implied by the sending of this email, or any 
attachments hereto.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20140516/5bade202/attachment.html>


More information about the Libwebsockets mailing list