From b0164920c75b613345e16640d0c219c903f0c83c Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Tue, 9 Oct 2018 19:31:49 -0700 Subject: [PATCH] increase timeout --- src/comm/comm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/comm/comm.go b/src/comm/comm.go index d5a905e7..02decfa7 100644 --- a/src/comm/comm.go +++ b/src/comm/comm.go @@ -18,7 +18,7 @@ type Comm struct { func New(c net.Conn) Comm { c.SetReadDeadline(time.Now().Add(3 * time.Hour)) c.SetDeadline(time.Now().Add(3 * time.Hour)) - c.SetWriteDeadline(time.Now().Add(5 * time.Second)) + c.SetWriteDeadline(time.Now().Add(20 * time.Second)) return Comm{c} } @@ -35,7 +35,7 @@ func (c Comm) Close() { func (c Comm) Write(b []byte) (int, error) { n, err := c.connection.Write(append([]byte(fmt.Sprintf("%0.5d", len(b))), b...)) if n != len(b)+5 { - err = fmt.Errorf("wanted to write %d but wrote %d", n, len(b)) + err = fmt.Errorf("wanted to write %d but wrote %d", len(b), n) } // log.Printf("wanted to write %d but wrote %d", n, len(b)) return n, err