AngularJS : socket.io destroy socket AngularJS : socket.io destroy socket angularjs angularjs

AngularJS : socket.io destroy socket


When I dealt with similar issues I had the conclusion that SocketIO has a messy state management to say the least... So I'd try to create my own reconnection logic, e.g. disable reconnection on disconnect or error, and only reconnect if I want it to.

I'd also consider using native SocketIO with state handlers like (stuff) => $timeout(() => myHandler(stuff)) and putting a singleton angular service around it. This way your head won't ache about closing modals, lost scopes, etc.

Also please send your results, I'm pretty interested what you have experienced since then.