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.
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 toconnection.on('error', onerror)
to get socket errors rather than have the done function called back a second time.