From 1bc53e1b15120d845d3b47fe52995e9bd87eb35f Mon Sep 17 00:00:00 2001 From: cx uname Date: Tue, 25 Feb 2014 16:45:30 +0400 Subject: [PATCH] dc fix2 --- main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index dae6767..e2e5378 100644 --- a/main.go +++ b/main.go @@ -26,8 +26,16 @@ var ( func main() { runtime.GOMAXPROCS(runtime.NumCPU()) + var ( + Conn *xmpp.Conn + err error + ) start: - Conn, err := xmpp.Dial("xmpp.ru:5222", "hypnotoad", "xmpp.ru", "pass", "AllHailHypnotoad", nil) + if Conn != nil { + log.Println("Conn check:", Conn.Close()) + } + + Conn, err = xmpp.Dial("xmpp.ru:5222", "hypnotoad", "xmpp.ru", "pass", "AllHailHypnotoad", nil) if err != nil { log.Println("Conn", err) time.Sleep(5 * time.Second)