From a19bce59988eb34ba093e7b2a947b4733bd98d47 Mon Sep 17 00:00:00 2001 From: raylu Date: Fri, 28 Jan 2011 21:03:45 -0500 Subject: [PATCH] Make a timeout so that Conn.Err closes when the connection is lost --- client/connection.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client/connection.go b/client/connection.go index 5afe9f4..4b04dd5 100644 --- a/client/connection.go +++ b/client/connection.go @@ -140,6 +140,7 @@ func (conn *Conn) Connect(host string, pass ...string) os.Error { conn.io = bufio.NewReadWriter( bufio.NewReader(conn.sock), bufio.NewWriter(conn.sock)) + conn.sock.SetTimeout(300000000000) // 5 minutes go conn.send() go conn.recv()