[Libwebsockets] libwebsockets-test-client timeout error

Andy Green andy at warmcat.com
Mon Apr 4 03:15:14 CEST 2016



On 04/04/2016 09:05 AM, Jun MA wrote:
> Hi guys,
>
> I’m new to lws and I met some issue when start playing with it. Hope you guys can help me out.
> I ran libwebsockets-test-server on my local machine and I can connect to it by web browser(127.0.0.1:7681), but when I tried 'libwebsockets-test-client localhost’, I got following messages:

Okay...

> [2016/03/03 17:45:36:4491] NOTICE: libwebsockets test client - license LGPL2.1+SLE
> [2016/03/03 17:45:36:4491] NOTICE: (C) Copyright 2010-2016 Andy Green <andy at warmcat.com>
> [2016/03/03 17:45:36:4491] NOTICE: Initial logging level 7
> [2016/03/03 17:45:36:4491] NOTICE: Libwebsockets version: 1.7.0 jun.ma at MacBook-Pro-2.local-v1.7.0-97-g0d0124a
> [2016/03/03 17:45:36:4491] NOTICE: IPV6 not compiled in
> [2016/03/03 17:45:36:4492] NOTICE: libev support not compiled in
> [2016/03/03 17:45:36:4492] NOTICE: libuv support not compiled in
> [2016/03/03 17:45:36:4492] NOTICE:  Threads: 1 each 2560 fds
> [2016/03/03 17:45:36:4492] NOTICE:  mem: platform fd map: 10240 bytes
> [2016/03/03 17:45:36:4493] NOTICE: Creating Vhost 'default' port -1, 2 protocols
> [2016/03/03 17:45:36:4493] NOTICE:  mem: per-conn:          332 bytes + protocol rx buf
> [2016/03/03 17:45:36:4493] NOTICE:  canonical_hostname = MacBook-Pro-2.local
> [2016/03/03 17:45:36:4493] NOTICE: using  mode (ws)
> [2016/03/03 17:45:36:4493] NOTICE: dumb: connecting
> [2016/03/03 17:45:36:4840] NOTICE: mirror: connecting
> [2016/03/03 17:45:57:0946] NOTICE: wsi 0x7c150920: TIMEDOUT WAITING on 2 (did hdr 0, ah 0x7ba2f098, wl 0, pfd events 0)
> [2016/03/03 17:45:57:0947] ERR: mirror: LWS_CALLBACK_CLIENT_CONNECTION_ERROR

It works OK here on Linux, one (unrelated) patch ahead at e599b4d16cb2.

$ libwebsockets-test-client localhost
[2016/03/04 09:08:04:0394] NOTICE: libwebsockets test client - license 
LGPL2.1+SLE
[2016/03/04 09:08:04:0394] NOTICE: (C) Copyright 2010-2016 Andy Green 
<andy at warmcat.com>
[2016/03/04 09:08:04:0394] NOTICE: Initial logging level 7
[2016/03/04 09:08:04:0395] NOTICE: Libwebsockets version: 1.7.0 
agreen at build.warmcat.com-v1.7.0-98-ge599b4d
[2016/03/04 09:08:04:0395] NOTICE: IPV6 not compiled in
[2016/03/04 09:08:04:0395] NOTICE: libev support not compiled in
[2016/03/04 09:08:04:0395] NOTICE: libuv support not compiled in
[2016/03/04 09:08:04:0396] NOTICE:  Threads: 1 each 100000 fds
[2016/03/04 09:08:04:0408] NOTICE:  mem: platform fd map: 800000 bytes
[2016/03/04 09:08:04:0409] NOTICE: Creating Vhost 'default' port -1, 2 
protocols
[2016/03/04 09:08:04:0409] NOTICE:  mem: per-conn:          432 bytes + 
protocol rx buf
[2016/03/04 09:08:04:0409] NOTICE:  canonical_hostname = build.warmcat.com
[2016/03/04 09:08:04:0409] NOTICE: using  mode (ws)
[2016/03/04 09:08:04:0409] NOTICE: dumb: connecting
[2016/03/04 09:08:04:0416] NOTICE: mirror: connecting
[2016/03/04 09:08:04:0424] NOTICE: mirror: LWS_CALLBACK_CLIENT_ESTABLISHED
[2016/03/04 09:08:04:5832] NOTICE: mirror: LWS_CALLBACK_CLOSED 
mirror_lifetime=0
[2016/03/04 09:08:06:0366] NOTICE: mirror: connecting
[2016/03/04 09:08:06:0372] NOTICE: mirror: LWS_CALLBACK_CLIENT_ESTABLISHED
[2016/03/04 09:08:06:9602] NOTICE: mirror: LWS_CALLBACK_CLOSED 
mirror_lifetime=0
[2016/03/04 09:08:08:0626] NOTICE: mirror: connecting
[2016/03/04 09:08:08:0632] NOTICE: mirror: LWS_CALLBACK_CLIENT_ESTABLISHED
[2016/03/04 09:08:08:6234] NOTICE: mirror: LWS_CALLBACK_CLOSED 
mirror_lifetime=0
^C


You should probably look at the logging on the server side to see what 
it thinks is happening, if you built with DEBUG target you can increase 
the logging with, eg, -d79 or -d65535

> [2016/03/03 17:45:57:0948] NOTICE: lws_header_table_detach: wsi 0x7c150920: ah held 21s, ah.rxpos 0, ah.rxlen 0, mode/state 10 4,wsi->more_rx_waiting 0
> [2016/03/03 17:45:57:0948] NOTICE: wsi 0x7af507e0: TIMEDOUT WAITING on 2 (did hdr 0, ah 0x7ba2e400, wl 0, pfd events 0)
> [2016/03/03 17:45:57:0948] ERR: dumb: LWS_CALLBACK_CLIENT_CONNECTION_ERROR
> [2016/03/03 17:45:57:0948] NOTICE: lws_header_table_detach: wsi 0x7af507e0: ah held 21s, ah.rxpos 0, ah.rxlen 0, mode/state 10 4,wsi->more_rx_waiting 0
> [2016/03/03 17:45:57:0948] NOTICE: dumb: connecting
> [2016/03/03 17:45:57:1273] NOTICE: mirror: connecting
> [2016/03/03 17:46:18:2726] NOTICE: wsi 0x7c250740: TIMEDOUT WAITING on 2 (did hdr 0, ah 0x7ba2f098, wl 0, pfd events 0)
> [2016/03/03 17:46:18:2727] ERR: mirror: LWS_CALLBACK_CLIENT_CONNECTION_ERROR
> [2016/03/03 17:46:18:2728] NOTICE: lws_header_table_detach: wsi 0x7c250740: ah held 21s, ah.rxpos 0, ah.rxlen 0, mode/state 10 4,wsi->more_rx_waiting 0
> [2016/03/03 17:46:18:2728] NOTICE: wsi 0x7c250500: TIMEDOUT WAITING on 2 (did hdr 0, ah 0x7ba2e400, wl 0, pfd events 0)
> [2016/03/03 17:46:18:2728] ERR: dumb: LWS_CALLBACK_CLIENT_CONNECTION_ERROR
> [2016/03/03 17:46:18:2728] NOTICE: lws_header_table_detach: wsi 0x7c250500: ah held 21s, ah.rxpos 0, ah.rxlen 0, mode/state 10 4,wsi->more_x_waiting 0
>
> I’m using mac os el capitan x86_64, I’m not sure if this is related but I do have a hard time trying to compile this library.
> If I built the make file by using cmake -DLWS_WITH_SSL=0, when making the file, I got the following:

Again there are no build problems on Linux / current master here, with a 
fresh build dir and cmake .. -DLWS_WITH_SSL=0

> Undefined symbols for architecture x86_64:
>   "_deflate", referenced from:
>       _lws_extension_callback_pm_deflate in extension-permessage-deflate.c.o
>      (maybe you meant: _lws_ext_pm_deflate_options, _lws_extension_callback_pm_deflate )
>   "_deflateEnd", referenced from:
>       _lws_extension_callback_pm_deflate in extension-permessage-deflate.c.o
>   "_deflateInit2_", referenced from:
>       _lws_extension_callback_pm_deflate in extension-permessage-deflate.c.o
>   "_inflate", referenced from:
>       _lws_extension_callback_pm_deflate in extension-permessage-deflate.c.o
>   "_inflateEnd", referenced from:
>       _lws_extension_callback_pm_deflate in extension-permessage-deflate.c.o
>   "_inflateInit2_", referenced from:
>       _lws_extension_callback_pm_deflate in extension-permessage-deflate.c.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make[2]: *** [lib/libwebsockets.7.dylib] Error 1
> make[1]: *** [CMakeFiles/websockets_shared.dir/all] Error 2
> make: *** [all] Error 2

Actually we autobuild against Mac using Travis and a variety of cmake 
options, and there are no problems there either.

https://travis-ci.org/warmcat/libwebsockets

> I tried cmake -DLWS_WITH_SSL=0 -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64, same error.
> So I had to use cmake -DLWS_WITH_SSL=0 -DCMAKE_OSX_ARCHITECTURES:STRING=i386 to by pass this error message.
> I’m not sure if this is related but this is the only thing I did so far.
>
> Looking forward any suggestion, thank you all in advance.

It looks like you needed to make sure zlib or zlib "devel package" 
whatever that looks like on OSX is installed for... maybe 64-bit zlib.

-Andy

> Bests,
> Jun
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://libwebsockets.org/mailman/listinfo/libwebsockets
>



More information about the Libwebsockets mailing list