Commit Graph

12 Commits

Author SHA1 Message Date
Matt Goodall cc012762e9 Replace Send/Recv funcs with In/Out channels.
Basically, make the channels public and just let the client handle a
stream/net error if it's interested.

This simplifies the API a little and also allows an application to
select {} from the XMPP channel and any other channels at the same time.
2012-07-18 11:22:59 +01:00
Matt Goodall 909d0f5fac Make example code easier to read with a bit of log-and-die trickery. 2012-07-12 00:38:51 +01:00
Matt Goodall 424c06855c Make stanza logging in the Stream optional. 2012-07-12 00:38:51 +01:00
Matt Goodall 6b01a7f10c Cleanly detect & signal end of stream, and fix code above. 2012-07-09 15:01:15 +01:00
Matt Goodall dc447769b2 go fmt 2012-07-09 02:21:18 +01:00
Matt Goodall 6a42d26a31 Log stanzas sent to the XMPP component. 2012-07-09 02:19:10 +01:00
Matt Goodall c9c8526476 Separate stream creation from XMPP use (client, component, etc).
The address of the server is not necessarily related to the JID, e.g.
DNS SRV lookups, manual configuration, etc. Splitting them up means
there's more control and flexibility over how things are put together.

We can always add convenience funcs later, e.g. something like
DialClient(jid, password), to handle the common case.
2012-07-08 23:33:37 +01:00
Matt Goodall 23aeb1fd68 Associate a JID with an XMPP instance.
Client connections negotiate a bound resource JID with the server. The
bound JID may be different from the one requested or even generated by
the server.

Component connections do not negotiate the bound JID but still have a
specific JID associated with the stream.
2012-07-08 12:18:51 +01:00
Matt Goodall 678b9c48a1 Make Stream public again, so we actually get some documentation for it. 2012-07-06 14:29:15 +01:00
Matt Goodall 627364727e The client and component connections are really just streams too.
Only difference is how they're setup. After that, it's the common iq,
message, presence stuff ... to come soon.
2012-07-06 11:47:15 +01:00
Matt Goodall ad000735ff Move flag vars out of main(). 2012-07-06 11:15:51 +01:00
Matt Goodall 7cf14c4f35 Add component API and example. 2012-06-27 13:14:18 +01:00