Is getNode a synchronous call? I was under the impression that it was, but when I make a call to it I can see that the next line is processed before I get a response from the server. I can see this in the smack debugger. It also seems that my connection dies when I try to get a node. I have a timer that I use to re-create my BOSHConnection if it dies. When I watch the debugger, I can see that it repeatedly dies after making the getNode call and eventually it will keep a connection and will get a response from the getNode request. Any thoughts on this would be great.
Yes, it is a synchronous call. The Smack library is multithreaded, which is pretty much required to support the asynchronous nature of the XMPP protocol. The smack debugger simply shows the exchange of stanzas between the client and the server. Synchronous calls from the API do not block messages from being received. The server will send messages to the client whenever there are message to send.
If the next line of code doesn’t execute until either a node is returned or an exception occurs, it is synchronous.
Sorry I can’t help you on the BOSH issue. I don’t know how well it works with the latest versions of Smack as it was written against pre 3.2.0.
Thanks for the information. I am using a version of BOSH that was written for 3.2.2 but I understand there could be an issue since it was written by a third party.
We use BOSH because security policy says we cannot communicate to XMPP’s port directly. Is there any other alternative we could use? I have seen with the Connection Configuration objects that there is a Proxy Info object - is there anything we could do with that that would allow us to use a built-in Smack connection?
Change your XMPP port from 5222 to any permitted port (80,8080, 8000). Unless you have a security firewall that inspects packet headers, that should work.
Thanks for the info, but the firewall will not allow the data through.
Would it be possible to do this on a webserver. So I could use port 80 or 443 for both XMPP traffic and web traffic?
brian wrote:
Thanks for the information. I am using a version of BOSH that was written for 3.2.2 but I understand there could be an issue since it was written by a third party.
Where can I find this BOSH version?
I could be wrong, but it seems that this is just the current smack trunk with the bosh branch merged (not an bosh version that was written for 3.2.2). But if this is not the case, I really would like to see the changes/improvements added to bosh branch too.
There is also my repo which contains additional bosh fixes.
Sorry about giving the wrong information. I believe it is a version of BOSH that just has updates for 3.2.2 merged in. I am looking at possiblities of not using BOSH but I believe it may still be a requirement for my particular project. Does your repo’s version of BOSH work with 3.2.2? If it does, have you had any issues with your server disconnecting your client because of an invalid session? Just trying to find out if this issue is because of the BOSH implementation I am using or some other error. It appears to mainly happen when I make a PubSub requeset to get a node.