--- a/examples/interact.go Sat Dec 24 13:11:36 2011 -0700
+++ b/examples/interact.go Sun Dec 25 18:46:13 2011 -0700
@@ -7,6 +7,7 @@
import (
"cjyar/xmpp"
"flag"
+ "fmt"
"log"
"os"
)
@@ -28,4 +29,19 @@
log.Fatalf("NewClient(%v): %v", jid, err)
}
defer c.Close()
+
+ go func(ch <-chan interface{}) {
+ for obj := range ch {
+ fmt.Printf("s: %v\n", obj)
+ }
+ fmt.Println("done reading")
+ }(c.In)
+
+ ch := make(chan interface{})
+ go xmpp.ReadXml(os.Stdin, ch, false)
+ for x := range ch {
+ fmt.Printf("c: %v", x)
+ c.Out <- x
+ }
+ fmt.Println("done sending")
}