diff --git a/lib/transports/http-polling.js b/lib/transports/http-polling.js index 89b7e0428b..392f09daa1 100644 --- a/lib/transports/http-polling.js +++ b/lib/transports/http-polling.js @@ -76,8 +76,12 @@ HTTPPolling.prototype.handleRequest = function (req) { var self = this; this.pollTimeout = setTimeout(function () { - self.packet({ type: 'noop' }); - self.log.debug(self.name + ' closed due to exceeded duration'); + try { + self.packet({ type: 'noop' }); + self.log.debug(self.name + ' closed due to exceeded duration'); + } catch(e) { + self.log.debug('socket destroyed'); + } }, this.manager.get('polling duration') * 1000); this.log.debug('setting poll timeout');