xmpp/xmpp.go
changeset 138 065f54e291c7
parent 135 a4755a42af19
child 141 f0d0f3b941a6
equal deleted inserted replaced
137:c94a7ce0f4fb 138:065f54e291c7
    97 
    97 
    98 // Connect to the appropriate server and authenticate as the given JID
    98 // Connect to the appropriate server and authenticate as the given JID
    99 // with the given password. This function will return as soon as a TCP
    99 // with the given password. This function will return as soon as a TCP
   100 // connection has been established, but before XMPP stream negotiation
   100 // connection has been established, but before XMPP stream negotiation
   101 // has completed. The negotiation will occur asynchronously, and any
   101 // has completed. The negotiation will occur asynchronously, and any
   102 // send operation to Client.Out will block until negotiation (resource
   102 // send operation to Client.Send will block until negotiation
   103 // binding) is complete.
   103 // (resource binding) is complete. The caller must immediately start
       
   104 // reading from Client.Recv.
   104 func NewClient(jid *JID, password string, tlsconf tls.Config, exts []Extension) (*Client, error) {
   105 func NewClient(jid *JID, password string, tlsconf tls.Config, exts []Extension) (*Client, error) {
   105 	// Include the mandatory extensions.
   106 	// Include the mandatory extensions.
   106 	roster := newRosterExt()
   107 	roster := newRosterExt()
   107 	exts = append(exts, roster.Extension)
   108 	exts = append(exts, roster.Extension)
   108 	exts = append(exts, bindExt)
   109 	exts = append(exts, bindExt)