From 6dfd9e096b3361751a795c38e03efccbb6c7d8eb Mon Sep 17 00:00:00 2001 From: Matt Goodall Date: Thu, 12 Jul 2012 00:40:55 +0100 Subject: [PATCH] Documentation tweaks and additions. --- src/xmpp/dns.go | 4 +++- src/xmpp/doc.go | 6 +++--- src/xmpp/xmpp.go | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/xmpp/dns.go b/src/xmpp/dns.go index b8015fe..3914460 100644 --- a/src/xmpp/dns.go +++ b/src/xmpp/dns.go @@ -6,11 +6,13 @@ import ( ) const ( + // Standard port for XMPP clients to connect to. XMPP_CLIENT_PORT = 5222 ) // Perform a DNS SRV lookup and return an ordered list of "host:port" TCP -// addresses for the JID's home server. +// addresses for the JID's home server. If no SRV records are found then assume +// the JID's domain is also the home server. func HomeServerAddrs(jid JID) (addr []string, err error) { // DNS lookup. diff --git a/src/xmpp/doc.go b/src/xmpp/doc.go index bfd752d..c131748 100644 --- a/src/xmpp/doc.go +++ b/src/xmpp/doc.go @@ -1,12 +1,12 @@ /* - Tools for implementing XMPP clients and components. + Package for implementing XMPP clients and components. - The package is built on the concept of an XML stream - a pair of XML + The package is built around the concept of an XML stream - a pair of XML documents written to and read from a TCP connection. Top-level elements in the document form the messages processed by either end of the connection. An XML stream is then configured for an XMPP conversation, as either a - client (chat, etc client) or component (a sort of server plugin). + client (chat, etc) or component (a sort of server plugin). Create a client: diff --git a/src/xmpp/xmpp.go b/src/xmpp/xmpp.go index 15e8ae3..9cfa6ce 100644 --- a/src/xmpp/xmpp.go +++ b/src/xmpp/xmpp.go @@ -6,8 +6,8 @@ import ( "sync" ) -// Handles XMPP conversations over a Stream. Use NewClientXMPP and/or -// NewComponentXMPP to create and configuring a XMPP instance. +// Handles XMPP conversations over a Stream. Use NewClientXMPP or +// NewComponentXMPP to create and configure a XMPP instance. type XMPP struct { // JID associated with the stream. Note: this may be negotiated with the // server during setup and so must be used for all messages.