[Libwebsockets] socket closes after receiving message

Andy Green andy at warmcat.com
Thu Apr 21 08:23:01 CEST 2016



On April 20, 2016 7:35:23 AM GMT+08:00, dabicho <tsukebumi at gmail.com> wrote:
>Hello.
>I am starting out with libwebsockets and websockets in general. With
>libwebsockets 1.7.5
>I am trying to re-implement the test example with only the http and
>status servers
>
>My connection is closing though, after the status message is sent.
>
>I don't see anything strange on the log except "error on reading from
>skt"
>And of course, the fact that it closes (not sure who is closing, if
>the client or the server)
>
>How can I further trace what is going wrong?

What happens with the actual test server on your platform... there's no problem?

What's the client, a browser?  Looking in the javascript console might be enlightening.

You can also use eg, tcpdump -I eth0 -s0 -X to see what happened on the wire.

-Andy

>Here is what I get from my server log:
>
>
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - websocket_server_manager[84]: Configuring
>libwebsockets syslog
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - websocket_server_manager[87]: starting server
>websocket
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - websocket_server_manager[120]: Using resource
>path "/media/sf_rpmbuild/DEVEL/siirfe_gphoto_server-1.0_test/src/"
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>Initial logging level 31
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>Libwebsockets version: 1.7.5 dabicho at localhost.localdomain-
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>IPV6 not compiled in
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>libev support not compiled in
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>Threads: 1 each 1024 fds
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>mem: platform fd map:  8192 bytes
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>mem: per-conn:          400 bytes + protocol rx buf
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>canonical_hostname = localhost.localdomain
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>Compiled with OpenSSL support
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]: SSL
>ciphers:
>'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:HIGH:!aNULL:!eN...28-GCM-SHA256
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>Using non-SSL mode
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>OpenSSL doesn't support ECDH
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 22
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[338]: LWS_CALLBACK_LOCK_POLL
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 32
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[342]: LWS_CALLBACK_UNLOCK_POLL
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>Listening on port 9000
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 27
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_camera_control[437]: Callback: 27
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_camera_control[444]: Inicializado,
>"version":"1.7.5 dabicho at localhost.localdomain-",
>"hostname":"localhost.localdomain"
>abr 19 18:27:53 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - websocket_server_manager[130]: Starting main
>loop
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[335]:
>LWS_CALLBACK_FILTER_NETWORK_CONNECTION
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 29
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 19
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[338]: LWS_CALLBACK_LOCK_POLL
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 32
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[342]: LWS_CALLBACK_UNLOCK_POLL
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 34
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_camera_control[437]: Callback: 20
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_camera_control[490]: reason 20 not
>handled
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_camera_control[437]: Callback: 0
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_camera_control[447]: Conexión
>establecida
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>cache_len 260
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[338]: LWS_CALLBACK_LOCK_POLL
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 34
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[342]: LWS_CALLBACK_UNLOCK_POLL
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[338]: LWS_CALLBACK_LOCK_POLL
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 34
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[342]: LWS_CALLBACK_UNLOCK_POLL
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_camera_control[437]: Callback: 11
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_camera_control[465]: Callback
>Writeable
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[338]: LWS_CALLBACK_LOCK_POLL
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 34
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[342]: LWS_CALLBACK_UNLOCK_POLL
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>error on reading from skt
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[338]: LWS_CALLBACK_LOCK_POLL
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 33
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 34
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[342]: LWS_CALLBACK_UNLOCK_POLL
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_camera_control[437]: Callback: 4
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_camera_control[473]: Callback Closed
>socket
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>CLOSING pss 0x7f7dc0036bf0 ********
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>cache_len 110
>abr 19 18:28:04 localhost.localdomain siirfe_gphoto_server[18985]:
>websocket_server.cxx - callback_http[363]: unhandled callback for 30
>_______________________________________________
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
>http://libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list