-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose hangup events from TcpStream? #245
Comments
Right now the "hup signal" is routed to being readable as I believe HUP means that read will always be ready with 0 bytes, will that work in this case? |
The argument could be that there is still buffered data on the socket that hasn't been read yet (because the server isn't ready to process) but then a HUP arrives... That said, I don't think getting HUP accurately is a portable feature. |
I'm fine with some platforms not being able to report a HUP. I don't think read readiness will work - I can't be constantly waiting on a read since the request handler may not be ready for more data. |
I'd say that this is definitely worth thinking about for the next iteration of Tokio. @sfackler have you commented re: this on the RFC? |
Nope, I will do so though! |
@sfackler oh FWIW this may have been in the meantime, there's now a |
I'm working on a server that processes fairly expensive requests. It's common for a client to give up waiting on the response and close the connection, but the server will continue working and only fail out after trying to write the it back. It'd be great if the server could be somehow notified that the stream's hung up so it can stop doing work immediately.
It's not totally clear to me how this would actually be exposed, but the ideal behavior would allow me to get a future that'd resolve after a hangup that I could select on against the handler logic.
The text was updated successfully, but these errors were encountered: