Comments (2)
@vganshin Hi Vladislav,
I believe, that it is possible to detect closed TCP connection.
That is correct, but unfortunately browsers don't typically close TCP connections when refreshing a page (or following links, etc.). The underlying TCP connection is usually reused in these cases.
If the browser does explicitly close the connection (for example if the page includes "Cache-Control: no-store" or "Pragma: no-cache", etc.) then the http-kit :on-close
event handler will fire as expected.
Otherwise you'll need to implement your own logic for detecting these kinds of discarded connections.
That's quite a large topic, but you can see Sente's implementation if you're looking for some possible ideas - here, for example.
I hope that helps?
from http-kit.
I got you. I knew (and successfully forgot), that browsers keep TCP connections alive. But I didn't thought that it reflects on server side in such a way.
Cache-Control, Pragma and even Connection: close headers didn't help. Anyway, async format it's not an issue anymore as it's needed in development. I just wanted to cleanup resources.
Thank you.
from http-kit.
Related Issues (20)
- Outdated http.async.client fails to compile HOT 2
- 2.8.0 beta1 blows up size of babashka image HOT 1
- Capture number of processors at runtime in a graalvm binary HOT 2
- http-kit client accepts some bad SSL certificates by default HOT 2
- Issue preventing non-keep-alive benchmarks HOT 1
- Race condition in TimerService.scheduleTask HOT 2
- Ring websocket API support HOT 4
- Problem in native-image and HttpUtils when using virtual threads HOT 11
- 2.8.0-beta2 has CIDER dependencies HOT 3
- CURL and finagle failing to parse :set-cookies with '\n' HOT 13
- Unix socket benchmark HOT 1
- It will turn headers into camel format HOT 2
- logger-warn gets rebound HOT 1
- logger-warn and error-warn are passed in wrong order to HttpServer constructor HOT 1
- Requests which throw java.net.ConnectException may actually succeed HOT 3
- Request Map doesn't contain information about authority HOT 8
- http-kit v2.8.0-RC1 HOT 1
- http-kit v2.8.0 final HOT 1
- Consider adding `Content-Type: text/plain` to HTTP 500 response in `org.httpkit.server.HttpHandler#run` HOT 6
- v2.7.0 SNI change broke connections to plain IP addresses with SSLHandshakeException "Hostname or IP address is undefined." HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http-kit.