Skip to content
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

(Server) Notification when remote closes the connection #1980

Closed
singpolyma-shopify opened this issue Oct 18, 2019 · 2 comments
Closed

(Server) Notification when remote closes the connection #1980

singpolyma-shopify opened this issue Oct 18, 2019 · 2 comments

Comments

@singpolyma-shopify
Copy link

It would be great if there were some way for my code to be "notified" when a client that has connected to my server and issued a request closes the connection on their end. That way, I could halt processing and save CPU building up a response that cannot be delivered anyway.

@sfackler
Copy link
Contributor

The server will generally drop the future if it detects that the connection has closed. In HTTP/1, you'll want to disable https://docs.rs/hyper/0.13.0-alpha.4/hyper/server/struct.Builder.html#method.http1_half_close to make sure that happens.

@seanmonstar
Copy link
Member

In #1981, the default will be changing so that its assumed read hups are closures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants