Possible implementation (Was: Re: XMPP Perlbal-like implementation)

Daniel Ruoso daniel at ruoso.com
Wed Apr 9 16:54:38 UTC 2008


Qua, 2008-04-09 às 15:04 +0100, Daniel Ruoso escreveu:
> The idea is pretty simple, the component registers itself in some
> server, and accepts connection from clients, allowing a JID to connect
> more than once, and then dispatch the incoming messages to the clients
> grouped by the jid, doing a job very similar to the one done by perlbal.

After some more code browsing, I think I found out where to implement
that feature, it seems that I just have to create a VHost subclass that
overrides register_jid, find_jid and unregister_jid.

I can do a simple trick of registering the jid with a postfix of, for
instance, '#'.$sock, and keep a HoA with the full jid and all
connections for that jid. In find_jid it's then just a matter of
choosing which $sock to return.

Do you think this is sane? Am I missing something?

daniel



More information about the Djabberd mailing list