Similar to #19 I'm looking into a way of handling re-connections if disconnected due to a socket error. My current solution is to register an error event listener, and simply call connect() (with no arguments).
The only issue I'm having with that is the client isn't designed to be used in this way, as the subscriptions and _stompFrameEmitter objects are re-used between connections, causing some side effects (messages being delivered multiple times, not re-subscribing to queues).
Hi,
Similar to #19 I'm looking into a way of handling re-connections if disconnected due to a socket error. My current solution is to register an
error
event listener, and simply callconnect()
(with no arguments).The only issue I'm having with that is the client isn't designed to be used in this way, as the
subscriptions
and_stompFrameEmitter
objects are re-used between connections, causing some side effects (messages being delivered multiple times, not re-subscribing to queues).Something like this https://gist.github.com/storkme/43dec2d73bef5d804375 seems to do the trick, but it's hardly elegant. Perhaps it would make sense to expose a
reset
function or similar?