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.
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). Hope that helps. Rodrigo Bernardo Pimentel wrote: > Hi there :) > > I'm a bit confused... I started writing a jabber client in Perl > using curses and Net::Jabber, as a programming exercise and as a means to > get myself more into jabber itself. But then it struck me as odd that I had > to either provide an integer number of seconds to Process() or leave it > blocking until it received any packets. In purely procedural programming, I > have to wait at least one second for the rest of the program to get > attention, and that includes an unpleasant delay in keystroke handling (for > example). > > I though of fork()ing and Process()ing in the child, communicating > via a socket or something, but then I saw DJ Adam's Jabber::Connection. His > process() simply exits if there's nothing to be processed in the queue, > which seems to me the Right Way (TM) to do it. > > Now, I'm not really sure Jabber::Connection and Net::Jabber actually > do the same thing (or should I say "are interchangeable"). Do/Are they? It > seemed so to me at first sight, and I was about to switch (even though > Net::Jabber seems to have function that give you what you want more promptly > (like GetFrom() etc)), but looking for examples on DJ Adam's page all I > found was programs using Net::Jabber, so, again, I got confused - are they > interchangeable? Or is Jabber::Connection directed towards soewhere else I > failed to recognize? > > Could anyone please show me the light? :) > > Thanks, > > > rbp > ______________________________________________________________________ > Rodrigo Bernardo Pimentel <[EMAIL PROTECTED]> > http://www.linuxsp.org.br http://isnomore.net > GPG: <0x81F85A48> 7E62 9CA2 C95B FC86 B334 203E C011 2E4D 81F8 5A48 > > ... You could spend *all day* customizing the title bar. > Believe me. I speak from experience. > -- Matt Welsh > _______________________________________________ > jdev mailing list > [EMAIL PROTECTED] > http://mailman.jabber.org/listinfo/jdev > _______________________________________________ jdev mailing list [EMAIL PROTECTED] http://mailman.jabber.org/listinfo/jdev
