Sorry, I don’'t know how to format code on this forum…
= new XMPPConnection(“jabber.org”);
// wait for isConnected() to become true or timeout and throw
// wait for isAuthenticated() to become true or timeout and throw
.sendMessage(“Howdy!”); <-- I want this to block
In this case, the message may never be sent because the connection closes too quick. I could put a sleep in here, but the sleep time would be arbitrary, and due to network and cpu loads I may be sleeping to long or not long enough. I would really like a blocking call, so that when I call con.close() I won’'t prevent the message from getting sent. I saw some other forum postings:
Both of these posts have been archived, but I don’'t see a fix/workaround as of yet.
I realize I could use a listener to see if the message is sent, but If I have multiple instances all sending the same message, I won’'t know which one arrived correctly.
Any ideas, workarounds, or a blocking method would be appreciated.