Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle reads from closed sockets and pipes better.
After closing a pipe or socket, a read will return an internal error whose text contains "use of closed network connection". Unfortunately, that appears to be the only way to detect that error, and golang/go#4373 suggests it's not going to improve on its own. Do what ~everyone else seems to have done in this case, check for the string. That gives us nicer diagnostics when a client or server shuts down in the normal course of its connections being terminated.
- Loading branch information
1 parent
d8632ec
commit 7eb9cc7
Showing
3 changed files
with
22 additions
and
3 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
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
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