[Libwebsockets] lws_client_connect_via_info() blocks for 30 seconds
Ian.M.Goldby at uniper.energy
Thu Mar 3 17:46:58 CET 2016
I'm evaluating libwebsockets for a websockets client in an embedded hardware project and I've quickly run into difficulties.
I'm using version 1.7.3 and trying to run the libwebsockets-test-client on an ARMLinux board to connect to libwebsockets-test-server on an Ubuntu Linux machine. For the time being I am not using SSL (but I ultimately this will be required).
The server works fine. I've tested it from Firefox and also from libwebsockets-test-client running on Ubuntu and Windows 7.
But when I run the test client on the ARMLinux system then it blocks in lws_client_connect_via_info() for 30 seconds. It then calls lws_service() twice, and each time it returns after 0.5 seconds as expected. But the third time it calls lws_service() it blocks for 30 seconds and during this time the server times out the connection, sending a TCP RST packet. At the end of the 30 seconds the client detects the closed connection (LWS_CALLBACK_CLIENT_CONNECTION_ERROR).
If I increase the server timeout to (say) 500 seconds then the client connects successfully (albeit taking a minute to do so) and then runs as expected from that point onwards.
(I'm using just the dumb-increment-protocol; I've completely removed the lws-mirror-protocol code from the client to keep things simple but it was failing for the same reason before I made any changes.)
The ARMLinux system uses Kernel 2.6.28, BusyBox v1.18.4 and uClibc-0.9.29.
Are there any known issues with libwebsockets on this configuration?
If not, please would you suggest where I could start looking for the cause of the 30 seconds blocking?
Thanks in anticipation for whatever suggestions you can offer.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libwebsockets