From d4f4aebce3ef2c18ef105349f50578da284b8748 Mon Sep 17 00:00:00 2001 From: cx uname Date: Wed, 14 Nov 2012 12:20:35 +0400 Subject: [PATCH] better dc handler. again --- main.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 8024290..00f0f08 100644 --- a/main.go +++ b/main.go @@ -30,15 +30,21 @@ func main() { start: Conn, err := xmpp.Dial("xmpp.ru:5222", "hypnotoad", "xmpp.ru", "pass", "AllHailHypnotoad", nil) if err != nil { - log.Fatalln("Conn", err) + log.Println("Conn", err) + time.Sleep(5 * time.Second) + goto start } - if err := Conn.SignalPresence("dnd", "is there some food in this world?", 11); err != nil { - log.Fatalln("Signal", err) + if err := Conn.SignalPresence("dnd", "is there some food in this world?", 12); err != nil { + log.Println("Signal", err) + time.Sleep(5 * time.Second) + goto start } if err := Conn.SendPresence(room+"/"+name, ""); err != nil { - log.Fatalln("Presence", err) + log.Println("Presence", err) + time.Sleep(5 * time.Second) + goto start } - + go func(Conn *xmpp.Conn) { for { select {