Skip to content

Commit

Permalink
fix GH-207
Browse files Browse the repository at this point in the history
  • Loading branch information
mokesmokes2 committed Jan 26, 2014
1 parent 5cbde0b commit b583fe4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,17 +561,13 @@ Socket.prototype.onClose = function (reason, desc) {
this.transport.removeAllListeners();

// set ready state
var prev = this.readyState;
this.readyState = 'closed';

// clear session id
this.id = null;

// emit events
if (prev == 'open') {
this.emit('close', reason, desc);
this.onclose && this.onclose.call(this);
}
// emit close event
this.emit('close', reason, desc);
}
};

Expand Down

0 comments on commit b583fe4

Please sign in to comment.