changeset 9 | 4fe926b03827 |
parent 6 | 8e425e340ca1 |
child 23 | b5de44679389 |
--- a/examples/interact.go Mon Dec 26 11:48:35 2011 -0700 +++ b/examples/interact.go Mon Dec 26 14:36:41 2011 -0700 @@ -37,11 +37,14 @@ 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 + p := make([]byte, 1024) + for { + nr, _ := os.Stdin.Read(p) + if nr == 0 { + break + } + s := string(p) + c.TextOut <- &s } fmt.Println("done sending") }