Commit Graph

18 Commits

Author SHA1 Message Date
Matt Goodall 9ba9dcbe86 go fix. Clearly, I need to run this more often ;) 2012-07-18 11:40:36 +01:00
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 b439198518 Convert FilterFn into the Matcher/MatcherFunc interface/adapter pair.
"Matcher" is a better name for how it's used. It also allows other types
to implement the interface.
2012-07-16 12:02:05 +01:00
Matt Goodall 20c380ebc6 Add UUID4 func and use it instead of hard-coded <iq/> ids. 2012-07-12 00:38:51 +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 2ab32b0959 Experimental XMPP filter-based API, including <iq/> send/recv helper.
The filter mechanism allows you to route any matching stanza to a custom
channel. The SendRecv(iq) method uses a once-only filter to watch for
a reply.
2012-07-09 02:08:01 +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 381c04b8b3 Pad out the standard XMPP stanzas a bit so they're at least useful. 2012-07-08 23:20:15 +01:00
Matt Goodall 01cff4b3ba Actually use TLS config passed to method. 2012-07-08 22:52:38 +01:00
Matt Goodall ce72493a2f Implement client resource binding. 2012-07-08 12:18:51 +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 9933414cc1 Rename demo -> client to make way for component example. 2012-06-27 12:10:57 +01:00