I am using the smack library along with the Jive Messenger and very much appreciate both offerings. I am having trouble moving ahead on my slowly-evolving application because of a basic lack of knowledge about the ‘‘state machine’’ involved in using Multi User Chat.
My test cycle, at the moment, only involves:
a. Make the connection.
c. Establish the muc.
d. Add a packet listener.
e. Join the muc.
f. Send a message to the muc.
g. Leave the muc.
h. Close the connection.
[All of the above, by the way, is carried out on a connection with your very
nice DEBUG_ENABLED, and the code is wrapped in try-catch blocks that
are giving me fine stack traces where applicable.]
Now I have several different, but related, questions about what is going on.
I will try to keep things simple and clear, however, by limiting one request for
help to one issue and work through the set constructively.
Here’'s basic question #1. The first time through this suite of calls, I get output
that seems reasonable. No exceptions are thrown. The second time, I can get
through steps a-d, but attempting to re-join throws the 409, Conflict, error.
I try to use the administrative interface to Jive Messenger to learn as much as I can,
about the ‘‘state machine’’, but I can’'t learn anything other than: The second session
connection is open, there is 1 member in the chat room.
It’'s pretty clear that my ‘‘leave()’’ did not occur. So, I stop and restart Jive Messenger,
knowing no other way to purge the ‘‘state machine’’. Then I try my loop a third time,
and, yes, it reproduces the output from the first loop.
What’'s the correct way to leave, shutdown, obliterate, or whatever a session in a
chat room so that the member can later re-enter with the same Nickname?