example/interact.go
changeset 159 fd4089f717b2
parent 153 bbd4166df95d
child 162 7b5586a5e109
--- a/example/interact.go	Sun Sep 29 21:37:14 2013 -0600
+++ b/example/interact.go	Sun Sep 29 21:54:38 2013 -0600
@@ -41,8 +41,14 @@
 		os.Exit(2)
 	}
 
+	stat := make(chan xmpp.Status)
+	go func() {
+		for s := range stat {
+			log.Printf("connection status %d", s)
+		}
+	}()
 	tlsConf := tls.Config{InsecureSkipVerify: true}
-	c, err := xmpp.NewClient(&jid, *pw, tlsConf, nil, xmpp.Presence{}, nil)
+	c, err := xmpp.NewClient(&jid, *pw, tlsConf, nil, xmpp.Presence{}, stat)
 	if err != nil {
 		log.Fatalf("NewClient(%v): %v", jid, err)
 	}