xmpp/xmpp.go
changeset 131 f9ccfaf672ed
parent 130 da6f37ae3ffe
child 132 feaa24de9597
equal deleted inserted replaced
130:da6f37ae3ffe 131:f9ccfaf672ed
   108 	exts = append(exts, bindExt)
   108 	exts = append(exts, bindExt)
   109 
   109 
   110 	// Resolve the domain in the JID.
   110 	// Resolve the domain in the JID.
   111 	_, srvs, err := net.LookupSRV(clientSrv, "tcp", jid.Domain)
   111 	_, srvs, err := net.LookupSRV(clientSrv, "tcp", jid.Domain)
   112 	if err != nil {
   112 	if err != nil {
   113 		return nil, errors.New("LookupSrv " + jid.Domain +
   113 		return nil, fmt.Errorf("LookupSrv %s: %v", jid.Domain, err)
   114 			": " + err.Error())
   114 	}
       
   115 	if len(srvs) == 0 {
       
   116 		return nil, fmt.Errorf("LookupSrv %s: no results", jid.Domain)
   115 	}
   117 	}
   116 
   118 
   117 	var tcp *net.TCPConn
   119 	var tcp *net.TCPConn
   118 	for _, srv := range srvs {
   120 	for _, srv := range srvs {
   119 		addrStr := fmt.Sprintf("%s:%d", srv.Target, srv.Port)
   121 		addrStr := fmt.Sprintf("%s:%d", srv.Target, srv.Port)