angular2-websocket icon indicating copy to clipboard operation
angular2-websocket copied to clipboard

`close` is not clean

Open troolee opened this issue 9 years ago • 3 comments

Hi afrad,

Using lib with ionic 2 app (tested with ionic serve). When I call close method websocket doesn't recognize this as 'clean' close. onCloseHandler handler receives an event with code == 1005. So the lib is trying to reconnect.

If it's a feature, not a bug, then how can I close the socket without auto reconnect? (I do need auto reconnect if connection is dropped by network issues, etc)

Thank you.

troolee avatar Nov 25 '16 08:11 troolee

now reconnect will work on closed on status code not 1000. maybe we can add a option to set when to reconnect ? i think this way may be help you? (∩_∩)

Lyoko-Jeremie avatar Nov 25 '16 14:11 Lyoko-Jeremie

Thank you for response. I think call back to decide if it's clean or not would be helpful. Or just assume that if connection was closed by close method it's clean. What do you think?

troolee avatar Nov 25 '16 17:11 troolee

i think you may like this #52

Lyoko-Jeremie avatar Nov 26 '16 08:11 Lyoko-Jeremie