I want some sugest!

ffsn-UbDI/[email protected] Tue, 29 Nov 2005 21:19:38 -0300 (BRT)
Newsgroups gmane.network.jabber.exodus.user
Message-ID <[email protected]>
 Hi guys, I'm developing an application using jabber. I have a problem.
 I did a method to receive messages from a chat group. When someone sends
a message to chat room, each client is going to receive this message. I
have a method wich  will be stay responsible to stay listening if the
message arrived. The problem is that when I call this method it prepairs
the listener that stay waiting. As I don't have how to know when a
message will arrive, I have to stay verifying the value of the variable
that will contain the received message(This is my idea). This way, I have
to put an "if" in a part of the code that will be stay always running.

 I would like to know any sugest of you, if there are ways more clever to
treat this problem

 thanks a lot.