Websockets immediate disconnection



I'm trying to use libsoup for handling websockets.

I'm creating a test program by modifying the simple-httpd.c code and adding a websocket handler.

soup_server_add_websocket_handler( server, "/ws", NULL, NULL, websocketCallback, NULL, destroy);

( I connect to the "message" signal in the callback so I can get data sent to the websocket
    g_signal_connect (connection, "message", G_CALLBACK (onMessage), NULL);  
)

The callback is hit when the connection is made but the websocket disconnects when the callback function returns.

I've probably missed something fundamental but can anyone give me a clue as to what might be going on (why the socket doesn't remain open so I can get and send data)?

The only code I can find is the 'websockets-test.c' file but that doesn't really help.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]