[jdev] Java XMPP libraries

ennova2005-jabber at yahoo.com ennova2005-jabber at yahoo.com
Mon May 22 12:43:46 CDT 2006


This is slightly dated - but if the original author is looking for some general discussion around poll/select and use of non blocking IO - the following is still a good resource

http://www.kegel.com/c10k.html


Norman Rasmussen <norman at rasmussen.co.za> wrote: On 5/20/06, Christian Cantrell  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/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/20060522/89f45599/attachment-0002.htm>


More information about the JDev mailing list