From 5110f80bba13e3758ae1836a88afee123df81e3e Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 13 Feb 2015 14:44:00 +0100 Subject: p2p: improve read deadlines There are now two deadlines, frameReadTimeout and payloadReadTimeout. The frame timeout is longer and allows for connections that are idle. The message timeout is still short and ensures that we don't get stuck in the middle of a message. --- p2p/peer.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'p2p/peer.go') diff --git a/p2p/peer.go b/p2p/peer.go index b61cf96da..f779c1c02 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -15,22 +15,12 @@ import ( "github.com/ethereum/go-ethereum/rlp" ) -const ( - // maximum amount of time allowed for reading a message - msgReadTimeout = 5 * time.Second - // maximum amount of time allowed for writing a message - msgWriteTimeout = 5 * time.Second - // messages smaller than this many bytes will be read at - // once before passing them to a protocol. - wholePayloadSize = 64 * 1024 - - disconnectGracePeriod = 2 * time.Second -) - const ( baseProtocolVersion = 2 baseProtocolLength = uint64(16) baseProtocolMaxMsgSize = 10 * 1024 * 1024 + + disconnectGracePeriod = 2 * time.Second ) const ( -- cgit