1
0
Fork 0
mirror of https://github.com/fluffle/goirc synced 2025-05-12 18:44:50 +00:00

Make a timeout so that Conn.Err closes when the connection is lost

This commit is contained in:
raylu 2011-01-28 21:03:45 -05:00 committed by Alex Bramley
parent 2a3ff18d73
commit a19bce5998

View file

@ -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()