Rantanen / node-mumble

Mumble client in Node.js
MIT License
155 stars 48 forks source link

The done callback should not be callable multiple times #64

Closed justinmchase closed 9 years ago

justinmchase commented 9 years ago

When I call connection.disconnect() it's possible for there to be a socket error regarding writing to a disconnected socket, which is a different issue.

But when this happens the callback to mumble.connect is being called again, which is confusing. This change still calls back done with the error if the error happens while connecting, but once connected the user will have to listen to connection.on('error', onerror) to get socket errors rather than have the done function called back a second time.

Rantanen commented 9 years ago

Good point!