[Libwebsockets] R: Unable to connect to the server with Android
stefano.mora at newdep.com
Wed Apr 17 09:55:37 CEST 2019
this morning I had a 'git pull' (some files was updated) and then rebuilt the library adding the DEBUG option.
Cmake worked well but when I compile by make I have the following error:
$ cd build
$ cmake –DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE=DEBUG ..
LWS_WITH_PEER_LIMITS = OFF
LWS_HAVE_ATOLL = 1
LWS_HAS_INTPTR_T = 1
LWS_WITH_EXPORT_LWSTARGETS = ON
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mora/Desktop/Socket/libwebsockets/build
mora at ubuntu-virtualbox:~/Desktop/Socket/libwebsockets/build$
mora at ubuntu-virtualbox:~/Desktop/Socket/libwebsockets/build$ make
Scanning dependencies of target websockets_shared
[ 1%] Building C object CMakeFiles/websockets_shared.dir/lib/core/alloc.c.o
In file included from /home/mora/Desktop/Socket/libwebsockets/lib/core/alloc.c:1:0:
/home/mora/Desktop/Socket/libwebsockets/lib/core/private.h:272:24: error: field ‘set’ has incomplete type
struct http2_settings set;
CMakeFiles/websockets_shared.dir/build.make:62: recipe for target 'CMakeFiles/websockets_shared.dir/lib/core/alloc.c.o' failed
make: *** [CMakeFiles/websockets_shared.dir/lib/core/alloc.c.o] Error 1
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/websockets_shared.dir/all' failed
make: *** [CMakeFiles/websockets_shared.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
My machine is a Ubuntu 18.04.2 LTS (Virtual machine)
Da: Andy Green <andy at warmcat.com>
Inviato: martedì 16 aprile 2019 16:59
A: Stefano Mora <stefano.mora at newdep.com>; libwebsockets at ml.libwebsockets.org
Oggetto: Re: [Libwebsockets] Unable to connect to the server with Android
On 16/04/2019 22:52, Stefano Mora wrote:
> I developed a ws server based on minimal sample: it is running on a Linux board.
> When I connect with browsers everything is OK.
> Now I'd like to connect with Android app and I'm using org.java-websocket:Java-WebSocket library.
> When I connect the app to the server the onOpen callback is fired with the 101 code and 'Switching Protocols' as message.
> The server does not enter in the ESTABLISHED phase and nothing else happen.
It sounds like you should watch the lws logging.
Build it with cmake -DCMAKE_BUILD_TYPE=DEBUG and enable all the log types (like -d 1151 or so) and take a closer look at if the logs contain a clue about how lws feels about the connection.
More information about the Libwebsockets