[JDEV] Net::Jabber vs. Jabber::Connection?

DJ Adams dj.adams at pobox.com
Sat Jun 1 19:07:19 CDT 2002


On Sat, Jun 01, 2002 at 04:10:51PM -0500, Ryan Eatmon wrote:
> 
> You could try Process(0) to wait 0 seconds (ie. exit immediatly).  As 
> for being odd that Process() blocks, this is the same behavior as many 
> other Perl modules (IO:Select comes to mind first).  I would argue that 
> Jabber::Connection is the odd man out.

Why?

J::C's process() uses IO::Select (specifically the can_read() function).
The behaviour is the same - it blocks for up to X seconds waiting for
something to be available. Calling process() (i.e. with no explicit
value) just makes the function assume 0 seconds.
 
> As for the differences between the two.  DJ wrote Jabber::XXXXXX as an 
> exercise and is slowly adding more to it.  Net::Jabber is meant to be a 
> 100% protocol compatible and high level implementation (in other words 
> GetFrom() is high level as it hides the guts from you).
  
It did start out as an excercise but turned out to be the module I was
looking for too ;-) It's different to N::J in that it's a lowlevel
lightweight approach. Rather than include high-level functions like
GetFrom(), it allows you to build your own (the equivalent here is 
attr('from')) using the NodeFactory module which was loosely aimed to
reflect the API of the xmlnode library in the open source Jabber server.
It gives you the flexibility to manipulate the nodes of the Jabber XML
protocol as you see fit.

The examples you see on some of my web pages are with N::J as that was
what I was using at the time. 

Although I've seen examples of people using both J::C and N::J together,
it's usually the case that people will find one or the other that they
feel comfortable with (bottom-up vs top-down approaches). 

Cheers
dj



More information about the JDev mailing list