From 5e5f5f0253273a19dbd296ec14183e0d34a30b20 Mon Sep 17 00:00:00 2001 From: kyle Date: Sat, 20 Dec 2014 20:39:44 +0200 Subject: [PATCH] Moved timeout to Client from Connect --- client/connection.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/connection.go b/client/connection.go index c7ba956..d94f736 100644 --- a/client/connection.go +++ b/client/connection.go @@ -128,6 +128,7 @@ func Client(cfg *Config) *Conn { } dialer := new(net.Dialer) + dialer.Timeout = cfg.Timeout if cfg.LocalAddr != "" { if !hasPort(cfg.LocalAddr) { cfg.LocalAddr += ":0" @@ -227,7 +228,6 @@ func (conn *Conn) Connect() error { if conn.connected { return fmt.Errorf("irc.Connect(): Cannot connect to %s, already connected.", conn.cfg.Server) } - conn.dialer.Timeout = conn.cfg.Timeout if conn.cfg.SSL { if !hasPort(conn.cfg.Server) { conn.cfg.Server = net.JoinHostPort(conn.cfg.Server, "6697")