Merge pull request #170 from nkzawa/patch-0

fix to check readyState
This commit is contained in:
Guillermo Rauch
2013-06-21 21:39:36 -07:00

View File

@@ -165,13 +165,13 @@ Polling.prototype.doClose = function(){
self.write([{ type: 'close' }]);
}
if (this.open) {
if ('open' == this.readyState) {
debug('transport open - closing');
close();
} else {
// in case we're trying to close while
// handshaking is in progress (GH-164)
debug('transport not open - defering close');
debug('transport not open - deferring close');
this.once('open', close);
}
};