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
This unfortunately is a long-standing issue (cf. #196 & #914), but there's plans to add functionality to GHC to get access to that information (cf. #937)
I came to the conclusion that for our use-case, it would be best to add functionality like this to the application protocol, because layer 2/3 connection information really depends on the setup; e.g. when adding a proxy it might break the connection detection again.
Is there a way to detect whether a client has vanished during a request?
setOnClose
will only fire at the very end as far as I can see.The following code tries to use
responseStream
, and byflush
ing before every delay I hoped it would realize the client is gone:When I run this and start a
curl http://localhost:1234
which I Ctrl+c after ~1-2 seconds, it will print:regardless of my client going away.
There is an old-ish SO question that creates a workaround by trying to read from the client socket in regular intervals.
The text was updated successfully, but these errors were encountered: