Asmack bosh not behave like it should

When using bosh configuration it should use 2 sockets for communication, but it’s look like this lib is using just one socket for communication and after sending empty message we are unable to send some new messages immediately (need to wait 60s - wait negotiation param).

Can anybody help me to find solution for this issue. Thanks.

Could you elaborate why it should use 2 sockets? Is this specified somewhere?

According to this specification:

Ahh I see.

As I told you in chat, the BOSH code hasn’t been actively developed in 5 years. Either that feature wasn’t implemented back then, or the specification changed in the meantime.

We are happy about every high-quality contribution. I’ve made the first steps to make jbosh run on Android a few months ago. So it should be possible to make bosh work on Android too. We just need someone willing to put work into it.

I just wanted to note, that we use jbosh (0.6.0) and the Smack BOSH classes with success. And you are probably not the first one using them. So maybe it could just be a misconfiguration on your side?

Would be great if you could test jbosh 0.8.0 and report back. It’s basically 0.6.0 with Apache httpclient for easier Android compability.

Unfortunately it’s not that easy to just replace jbosh in our project, cause we made some changes to the jbosh code. They are not related to the bosh technique, but to detecting network failures better.

I tried to build with new jbosh but no success. build.bash is not configured to work with newer jbosh. Also I noticed that jbosh is now part of ignite (org.igniterealtime.jbosh package - but dont know if this is 0.8.0 version).

I’m not sure if I misconfigured bosh, but by looking source code, I dont see where lib create new “connection” (other socket) mentioned in bosh technique.

I’m interested to incooperate every beneficial change to jbosh. Are you permitted to release those changes under the Apache License 2.0? Or do they apply only to your environment and are not helpful for others?

I have found the same issue (I believe) - when using a BOSH connection if you send multiple messages the Smack client delievers them one every 60 seconds, or if the other user sends you a message you send another per messages received.

Setting the server property xmpp.httpbind.client.requests.wait to 1 - changes the wait to one second.

Am still working out the true impact of this (as I am changing it blind to the exact meaning) - but happy to update once more testing has been performed.

That’s the same issue. And the same “solution”.


The issue is because as mentioned in XEP-0124, the hold variable is set to 1 and the same is hardcoded in the jBOSH client code.

This will make the performance of jBOSH client better.

I have asked a question on jdev[at] that what are the ramifications of it.

If the hold variable is set to a higher value then the performance of BOSH client will be better.

Hoping to make it work after building smack code with the change.

If the hold variable is set to a higher value then the performance of BOSH client will be better.

I doubt that this claim is true.

Thanks @Flow

I was looking for some inputs on this.

I am looking at the smack bosh code. to find a way to initiate a new socket on arrival of a new message send request.

Increasing the ‘hold’ value will not automagically improve the responsiveness. jBOSH should initiate a new HTTP connection if there is currently just one waiting in long poll. Judging from the user reports here in the forums, there appears to be an issue with jBOSH delaying the sending (sometimes?) by ~ 1 minute. I believe that this is a bug in jBOSH and/or its supporting libraries, and I doubt that this can be changed by simply increasing the value of ‘hold’.

The Smack’s BOSH code and jBOSH are currently unmaintained and in desperate need for some love. I don’t have the time to do so nor the interest. But this can, of course, be changed by hiring me as contractor.