diff --git a/lib/spdy/server.js b/lib/spdy/server.js index 1889fcd..bcbd58b 100644 --- a/lib/spdy/server.js +++ b/lib/spdy/server.js @@ -124,11 +124,12 @@ proto._handleConnection = function _handleConnection (socket, protocol) { connection.start(2) } - connection.on('error', function () { + var self = this + connection.on('error', function (error) { + self.emit('sessionError', error, socket) socket.destroy() }) - var self = this connection.on('stream', function (stream) { self._onStream(stream) })