[Libwebsockets] R: Unable to connect to the server with Android

Stefano Mora stefano.mora at newdep.com
Wed Apr 17 09:55:37 CEST 2019

Thanks Andy,
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
-- 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[2]: *** [CMakeFiles/websockets_shared.dir/lib/core/alloc.c.o] Error 1
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/websockets_shared.dir/all' failed
make[1]: *** [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)

-----Messaggio originale-----
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:
> Hello,
> 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 mailing list