xmpp.go
changeset 123 42a9995faa38
parent 121 ebb86cbdd218
equal deleted inserted replaced
122:ab22b4285d12 123:42a9995faa38
    63 // Allows the user to override the TLS configuration.
    63 // Allows the user to override the TLS configuration.
    64 var TlsConfig tls.Config
    64 var TlsConfig tls.Config
    65 
    65 
    66 // The client in a client-server XMPP connection.
    66 // The client in a client-server XMPP connection.
    67 type Client struct {
    67 type Client struct {
    68 	// This client's unique ID. It's unique within the context of
       
    69 	// this process, so if multiple Client objects exist, each
       
    70 	// will be distinguishable by its Uid.
       
    71 	Uid string
       
    72 	// This client's JID. This will be updated asynchronously by
    68 	// This client's JID. This will be updated asynchronously by
    73 	// the time StartSession() returns.
    69 	// the time StartSession() returns.
    74 	Jid          JID
    70 	Jid          JID
    75 	password     string
    71 	password     string
    76 	socket       net.Conn
    72 	socket       net.Conn
   137 		return nil, err
   133 		return nil, err
   138 	}
   134 	}
   139 
   135 
   140 	cl := new(Client)
   136 	cl := new(Client)
   141 	cl.Roster = *roster
   137 	cl.Roster = *roster
   142 	cl.Uid = NextId()
       
   143 	cl.password = password
   138 	cl.password = password
   144 	cl.Jid = *jid
   139 	cl.Jid = *jid
   145 	cl.socket = tcp
   140 	cl.socket = tcp
   146 	cl.handlers = make(chan *stanzaHandler, 100)
   141 	cl.handlers = make(chan *stanzaHandler, 100)
   147 	cl.inputControl = make(chan int)
   142 	cl.inputControl = make(chan int)