powered by Jive Software

Smack for web based chat

Hi ,

I am trying to use smack in a web based chat application, using servlets and am running into a few issues.

The problem I face is that, after I log into the server and send a message from one user using chat.sendMessage(“text”), I am not able to retrieve that message from the server using chat.pollMessage() of the other user. Having a listener for every connection is not an efficient or an ideal solution for me.

Could someone please let me know how else can I retrieve messages?

Any help would be appreciated.

Thanks in advance,



I think you really should add Events to the XMPPConnection object, it is usually better to handle the messages in an asynchronous way, specially when we are talking about IM . Read the documentation about adding listeners.

Good luck