xmpp/layer2.go
changeset 147 d7679d991b17
parent 145 21a390dd3506
child 163 3f891f7fe817
--- a/xmpp/layer2.go	Sun Sep 15 12:42:49 2013 -0600
+++ b/xmpp/layer2.go	Sun Sep 15 13:09:26 2013 -0600
@@ -11,7 +11,9 @@
 	"strings"
 )
 
-func readXml(r io.Reader, ch chan<- interface{},
+// Read bytes from a reader, unmarshal them as XML into structures of
+// the appropriate type, and send those structures on a channel.
+func recvXml(r io.Reader, ch chan<- interface{},
 	extStanza map[xml.Name]reflect.Type) {
 	if _, ok := Debug.(*noLog); !ok {
 		pr, pw := io.Pipe()
@@ -129,7 +131,9 @@
 	return nil
 }
 
-func writeXml(w io.Writer, ch <-chan interface{}) {
+// Receive structures on a channel, marshal them to XML, and send the
+// bytes on a writer.
+func sendXml(w io.Writer, ch <-chan interface{}) {
 	if _, ok := Debug.(*noLog); !ok {
 		pr, pw := io.Pipe()
 		go tee(pr, w, "C: ")