Closed Globik closed 4 years ago
Closing as duplicate of #17.
Reopening this issue: issue #17 has been modified to track only implementation of HTTP/2. Experimental websockets has been pushed to the websockets-experimental
branch.
Is lwan_response_websocket_read supposed to work by now?
I can run the websocket sample but when I modify it to wait for data, lwan_response_websocket_read call just eats control flow and disconnects the client.
Something like this:
LWAN_HANDLER(ws)
{
enum lwan_http_status status = lwan_request_websocket_upgrade(request);
if (status != HTTP_SWITCHING_PROTOCOLS)
return status;
while (true) {
lwan_response_websocket_read(request)
lwan_response_websocket_write(request);
}
return HTTP_OK;
}
Will look at it whenever I'm close to my computer. It should be working, but this code has been refactored so much without tests that there might be indeed issues.
On Mon, Nov 12, 2018, 07:20 Alex Hultman notifications@github.com wrote:
Is lwan_response_websocket_read supposed to work by now?
I can run the websocket sample but when I modify it to wait for data, lwan_response_websocket_read call just eats control flow and disconnects the client.
Something like this:
LWAN_HANDLER(ws) { enum lwan_http_status status = lwan_request_websocket_upgrade(request);
if (status != HTTP_SWITCHING_PROTOCOLS) return status; while (true) { lwan_response_websocket_read(request) lwan_response_websocket_write(request); } return HTTP_OK;
}
— You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub https://github.com/lpereira/lwan/issues/230#issuecomment-437919372, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA6mbPWF6iY94eveilZ589-9IUHYcEIks5uuZG8gaJpZM4TzGSA .
It should be working now, ~2 years later. The sample app has 3 samples in one now, including a chat app with an internal pub/sub mechanism.
It would be nice to have websocket.