Skip to content

Commit

Permalink
Fix: mark the connection as closed only after closing the connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
kadishmal committed Feb 24, 2015
1 parent cb93c1c commit 39fd509
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CUBRIDConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1307,11 +1307,11 @@ function close(callback) {
socket.write(packetWriter._buffer);
}
], function (err) {
Helpers._emitEvent(self, err, self.EVENT_ERROR, self.EVENT_CONNECTION_CLOSED);

// Reset connection status
self.connectionPending = false;
self.connectionOpened = false;

Helpers._emitEvent(self, err, self.EVENT_ERROR, self.EVENT_CONNECTION_CLOSED);

if (typeof(callback) === 'function') {
callback(err);
Expand Down

0 comments on commit 39fd509

Please sign in to comment.