You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're implementing a long polling scheme where the client sends a request, and the server blocks in the request handler until a server-side event occurs. The client has keep-alive enabled, and a 10s read timeout. To not block the worker thread forever/longer than needed, I'd like to detect the client disconnect, so that the request handler can periodically check for that, and abort waiting for the server-side event if the client connection is gone.
I see no API for that, is that missing, or by design?
(Alternatively, or in addition, I could implement a server-side timeout when waiting for the event, with the disadvantage that it might differ from the timeout used by the client, and that other disconnects wouldn't be detected)
The text was updated successfully, but these errors were encountered:
@frankosterfeld I added DataSink::is_writable() with which you can check if the socket is still alive. You can see how it can be used in 'LongPollingTest.ClientCloseDetection' in test.cc. Hope it helps!
We're implementing a long polling scheme where the client sends a request, and the server blocks in the request handler until a server-side event occurs. The client has keep-alive enabled, and a 10s read timeout. To not block the worker thread forever/longer than needed, I'd like to detect the client disconnect, so that the request handler can periodically check for that, and abort waiting for the server-side event if the client connection is gone.
I see no API for that, is that missing, or by design?
(Alternatively, or in addition, I could implement a server-side timeout when waiting for the event, with the disadvantage that it might differ from the timeout used by the client, and that other disconnects wouldn't be detected)
The text was updated successfully, but these errors were encountered: