equal
deleted
inserted
replaced
8 "cjyar/xmpp" |
8 "cjyar/xmpp" |
9 "flag" |
9 "flag" |
10 "fmt" |
10 "fmt" |
11 "log" |
11 "log" |
12 "os" |
12 "os" |
13 ) |
13 ) |
14 |
14 |
15 // Demonstrate the API, and allow the user to interact with an XMPP |
15 // Demonstrate the API, and allow the user to interact with an XMPP |
16 // server via the terminal. |
16 // server via the terminal. |
17 func main() { |
17 func main() { |
18 var jid xmpp.JID |
18 var jid xmpp.JID |
26 |
26 |
27 c, err := xmpp.NewClient(&jid, *pw, nil) |
27 c, err := xmpp.NewClient(&jid, *pw, nil) |
28 if err != nil { |
28 if err != nil { |
29 log.Fatalf("NewClient(%v): %v", jid, err) |
29 log.Fatalf("NewClient(%v): %v", jid, err) |
30 } |
30 } |
31 defer c.Close() |
31 defer close(c.Out) |
32 |
32 |
33 err = c.StartSession(true, &xmpp.Presence{}) |
33 err = c.StartSession(true, &xmpp.Presence{}) |
34 if err != nil { |
34 if err != nil { |
35 log.Fatalf("StartSession: %v", err) |
35 log.Fatalf("StartSession: %v", err) |
36 } |
36 } |