I have to write a chat client using the Jabber (XMPP) protocol. This
is to be accessed from a regular java web app by browser users in a
simple manner. I won't be using java web start at the moment (I may
later). At the moment I have an invisible Applet (yuk I know) that
connects to the chat server, but because applets virtually always
dispose on page nav, I have to close the connection and reconnect each
time. I can't serialise the connection, it isn't serialisable.
The invisible applet is just to maintain server connection, and hence
listen for chat requests. A sequence of dialogues accept or reject a
chat request and when both parties agree a browser window containing
the chat gui applet is created. Plenty of java chat apps exist like
this, it can't be this hard. What is a good way to do this? My main
problems stem from the ridiculous disconnect/reconnect, every reconnect
gets old chat request that have already been dealt with (XMPP quirk?)
Any advice welcome
Mike W
Oliver Wong - 28 Jun 2006 18:27 GMT
> I have to write a chat client using the Jabber (XMPP) protocol. This
> is to be accessed from a regular java web app by browser users in a
[quoted text clipped - 11 lines]
> gets old chat request that have already been dealt with (XMPP quirk?)
> Any advice welcome
The only implementation I've seen of this uses polling. Messages are
sent to a central server which acts as a message queue, and your invisible
applet would periodically check if messages are awaiting the currently
logged in viewer or not.
I don't know how compatible this would be with the XMPP protocol.
- Oliver