xmppo / node-xmpp-bosh

An XMPP BOSH & WebSocket server (connection manager) written on node.js using Javascript
https://github.com/xmppo/node-xmpp-bosh
263 stars 85 forks source link

Active stream statistic can become negative #84

Open gavllew opened 11 years ago

gavllew commented 11 years ago

After leaving NXB running for a few weeks handling WebSocket connections, I've found the number of active streams is shown as "-1/2865". I'm not on the latest code, but I don't think the WebSocket stuff has changed much since a1ab095625678dd876986cba8c252612e817b0b6.

I'm guessing that there are some fringe cases where the 'close' event gets fired more than once for a given WS, and we decrement the statistic every time. Should probably move stat_stream_terminate() to the two places where we emit the 'stream-terminate' event on wsep.

zlokomatic commented 10 years ago

I also got this problems after some hours. Stats showing: -3/146771