fivebeans
fivebeans copied to clipboard
fix: cleanup before new connection
@ceejbot,
Enables reuse of fivebeans handler.
Since I want to reuse the same fivebeans client object for reconnection, I call FiveBeansClient.prototype.connect() more than once.
As a result, a callback for an old socket may exist in self.handlers after a new socket is created. In this case, the first command with the new socket will stuck, because its callback will not be called (a callback for the old socket will be called instead).