p2p: restore read/write timeouts

They got lost in the transition to rlpxFrameRW.
This commit is contained in:
Felix Lange
2015-03-04 16:27:37 +01:00
parent 6e7e5d5fd5
commit 22659a7fea
5 changed files with 37 additions and 37 deletions

View File

@ -20,8 +20,8 @@ const (
baseProtocolLength = uint64(16)
baseProtocolMaxMsgSize = 10 * 1024 * 1024
disconnectGracePeriod = 2 * time.Second
pingInterval = 15 * time.Second
disconnectGracePeriod = 2 * time.Second
)
const (
@ -176,6 +176,7 @@ func (p *Peer) politeDisconnect(reason DiscReason) {
func (p *Peer) readLoop() error {
for {
p.conn.SetDeadline(time.Now().Add(frameReadTimeout))
msg, err := p.rw.ReadMsg()
if err != nil {
return err