[Libwebsockets] lws_client_connect_via_info() blocks for 30 seconds

Goldby, Ian Ian.M.Goldby at uniper.energy
Fri Mar 4 10:01:59 CET 2016

On March 3 21:06 GMT, Andy Green wrote:
> On March 4, 2016 12:46:58 AM GMT+08:00, "Goldby, Ian" <Ian.M.Goldby at uniper.energy> wrote:
> >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. ...
> >
> >But when I run the test client on the ARMLinux system then it blocks in
> >lws_client_connect_via_info() for 30 seconds. ... and the server times
> > out the connection ...
> Generally, network app sitting there for 20 - 30s, the first suspect is name resolution
> broken, either dns or rdns.

Yes, that was it. It was blocking in the call to getaddrinfo() in lws_client_connect_2(),
since there is no DNS on the test network I am using. I removed the nameserver entry
from the /etc/resolv.conf file and this has resolved the problem. (I'm slightly surprised
because I've been using IP addresses exclusively - no host names in sight - but as you
hint, perhaps it is trying to do reverse-DNS on the IP address. Something I should read
up on.)

> >Are there any known issues with libwebsockets on this configuration?
> No... Arm is a first-class citizen for lws.  Libwebsockets.org and his lws test server
> runs on a Cortex A7, although on Fedora / glibc.
> Check your target's /etc/resolv.conf and /etc/nsswitch.conf, and if it has it, ping
> (what's the rdns name like?) or dig the server address from the commandline to see if
> also delayed.  I would guess first this is something related to platform configuration,
> not lws itself.
> -Andy
Many thanks, Andy.


More information about the Libwebsockets mailing list