[Libwebsockets] Use of libwebsockets_serve_http_file()

Mark Hessling rexx.org at internode.on.net
Thu Oct 15 07:04:50 CEST 2015


I have built a Rexx API for lws and have been using it successfully for 
several months now.  I have recently come across a behavioural problem 
with libwebsockets_serve_http_file(). I assume that the purpose of this 
function is to let lws serve the requested file back to the client and 
that's all the server has to do, but I've found that this is not reliable.

If I attempt to serve a largish (130k) file back to a client where the 
connection is slow, the client times out waiting for the server to send 
the file.  In my particular circumstance I am serving the JQuery 
Javascript package back to a client running on a mobile phone over a 
cellular network.  If the connection is fast (client and server on same 
network) the file is served completely.
I've easily replicated this problem on a local network by using Chrome's 
throttling mechanism in its developer tools.

Am I assuming the incorrect behaviour of libwebsockets_serve_http_file() 
for large files over slow connections, or should it work?

Thanks, Mark
------------------------------------------------------------------------
* Mark Hessling, mark at rexx.org http://www.rexx.org/
* Author of THE, a Free XEDIT/KEDIT editor and, Rexx/SQL, Rexx/CURL, etc.
* Maintainer of Regina Rexx interpreter and Rexx/Tk
* Use Rexx? join the Rexx Language Association: http://www.rexxla.org/
------------------------------------------------------------------------



More information about the Libwebsockets mailing list