-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix WebSocket timeout handling in nasty-client (#1512)
The server might close an idle connection after 60s. This should not be considered an error. Currently, though, it is causing errors, because our caluclation of idle time is not correct. We are using time since last read, but a read doesn't necessarily mean traffic over the connection. We might be reading a message that was sent long ago and has been sitting in our TCP buffer while the connection has been idle. To more accurately gauge how long the connection has been idle, we use time since the last _blocking_ read. Thus, we are less likely to produce an error, and more likely to just chalk ConnectionReset errors up to a stale stream and refresh the stream and continue.
- Loading branch information
Showing
1 changed file
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters