0
votes

I am using Openfire 3.9.3 and had created web chat application with strope.js. When the less number of user on openfire were there the connection was stable. but there are lots of users registered on that app. Users are not online still my connection disconnected repeatedly I again connect on_disconnected(). The connection is made but again it get disconnected with

NetworkError: 404 Invalid SID. - http://127.0.0.1:7070/http-bind/

is it client side defect or server side defect? How to solve this?

3

3 Answers

2
votes

Openfire generally pings the client on a regular interval to check if the client is alive. When the client fails to respond within the specified timeout, the server infers the client has disconnected.

The error you are getting is page not found error which basically means that either there is some problem with your listening port or network.

However since you are using loopback address, the network possibility is ruled out. Check your server port as I (even though the code is not given for reference) feel that your client may not have any problems. Just make sure the binding address is up and right.

0
votes

I had the same problem in my code (I'm using my version of Candy Chat), and the problem was I wasn't calling the BOSH _proto version of _doDisconnect in time.

_doDisconnect: function ()
    {
        this.sid = null;
        this.rid = Math.floor(Math.random() * 4294967295);
        window.sessionStorage.removeItem('strophe-bosh-session');
    },

You must make sure this is called before your code calls the Strophe _changeConnectStatus function for a disconnect. Or at least set the current connection this.sid = null.

In other words, you have to make sure Strophe nulls the current "sid" value so the next ping sends no "sid" or a new one (I think none, but might be a new one). If not, your client side next "send" ping has the old value in it even though the server now disconnecting. Then the server gives the not very informative 404 error, which is actually letting you know that that connection is no longer valid (which of course is what I wanted in the first place). Sort of a which came first, the chicken or the egg problem.

Hope that helps a little with one version of why that error comes up. The standard version of Candy Chat resets everything before every connection attempt, so it doesn't have this problem.

0
votes

update keepalive value at client side. default is 120 seconds.