[jdev] Java XMPP libraries

Norman Rasmussen norman at rasmussen.co.za
Sat May 20 16:23:21 CDT 2006


On 5/20/06, Christian Cantrell <christiancantrell at mac.com> wrote:
> On May 19, 2006, at 8:58 PM, Trejkaz wrote:
> I can get the component working, I just don't like the architecture.
> All the examples I've seen use an infinite loop to process packets
> from the stream rather than blocking until packets come in and then
> routing them appropriately.  If I knew why it was done this way, and
> the advantages, I would probably be ok with it, but it seems like an
> unnecessary waste of resources as the infinite loop is very processor
> intensive.  Any idea why the demos are done this way?

Why don't you use the java equivalent of poll or select? This way the
program will block when there's nothing to do, and only 'execute' when
data is received.

-- 
- Norman Rasmussen
 - Email: norman at rasmussen.co.za
 - Home page: http://norman.rasmussen.co.za/



More information about the JDev mailing list