forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpc/comms: use ConnState to track HTTP connections
The JSON-RPC server wraps TCP connections in order to be able to shut down them down when RPC is stopped. This is rather scary code. Go 1.3 introduced the http.Server.ConnState hook for such purposes. We can use this facility now that we depend on Go 1.4. There are multiple reasons for the switch apart from making the code less scary: * the TCP listener no longer ticks every second to check a channel * pending requests are allowed to finish after stopping the server * we can time out idle keep-alive connections
- Loading branch information
Showing
2 changed files
with
162 additions
and
205 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
Oops, something went wrong.