Possible implementation (Was: Re: XMPP Perlbal-like
implementation)
Martin Atkins
mart at degeneration.co.uk
Mon Apr 14 17:59:42 UTC 2008
Daniel Ruoso wrote:
> 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?
>
VHost wasn't really designed to be subclassed. The usual extension
mechanism is via hooks. Do you think that what you're doing could be
implemented with hooks, and if so what hooks would you need in addition
to what's already there?
Cheers,
Martin
More information about the Djabberd
mailing list