mirror of https://github.com/fluffle/goirc
Make a timeout so that Conn.Err closes when the connection is lost
This commit is contained in:
parent
2a3ff18d73
commit
a19bce5998
|
@ -140,6 +140,7 @@ func (conn *Conn) Connect(host string, pass ...string) os.Error {
|
||||||
conn.io = bufio.NewReadWriter(
|
conn.io = bufio.NewReadWriter(
|
||||||
bufio.NewReader(conn.sock),
|
bufio.NewReader(conn.sock),
|
||||||
bufio.NewWriter(conn.sock))
|
bufio.NewWriter(conn.sock))
|
||||||
|
conn.sock.SetTimeout(300000000000) // 5 minutes
|
||||||
go conn.send()
|
go conn.send()
|
||||||
go conn.recv()
|
go conn.recv()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue