diff --git a/lib/transports/polling.js b/lib/transports/polling.js index fbe4ad40..8aff87c3 100644 --- a/lib/transports/polling.js +++ b/lib/transports/polling.js @@ -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); } };