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

Normal HTTP connections kept open #37

Open
asprionj opened this issue Apr 6, 2019 · 1 comment
Open

Normal HTTP connections kept open #37

asprionj opened this issue Apr 6, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request low priority

Comments

@asprionj
Copy link
Contributor

asprionj commented Apr 6, 2019

To enable arbitrarily long websocket connections, we set readtimeout = 0 on HTTP.listen. The downside of this is that also standard HTTP requests are kept open. When running with verbose=true, one gets several Closed (x): ... Info's per viewer of index.html some minutes after having stopped the server. It's always the ones not corresponding to a websocket.

This is invisible in non-verbose mode, and does not bind many resources, so it is not severe. But it should be addressed anyway, which needed to be done in HTTP.jl. So we'd have to think about a good way of doing this (having a websocket-specific readtimeout with default 0) and file another pull request...

@asprionj asprionj added enhancement New feature or request low priority labels Apr 6, 2019
@fonsp
Copy link
Collaborator

fonsp commented Mar 25, 2022

It might be that the WS connection closes because LiveServer.jl does not implement the ping-pong messages, which force the TCP connection to remain open despite timeouts: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#pings_and_pongs_the_heartbeat_of_websockets

This is implemented in HTTP.WebSockets, but since LiveServer.jl only uses that library partially, I am not sure whether this got carried over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority
Projects
None yet
Development

No branches or pull requests

2 participants