diff --git a/dao/socketServer.js b/dao/socketServer.js index cd2e298..b192b41 100644 --- a/dao/socketServer.js +++ b/dao/socketServer.js @@ -259,7 +259,6 @@ function serverCreated(socket) { } function startServer() { - var self = this; this.log( 'starting server on ',this.path, ((this.port)?`:${this.port}`:'') @@ -290,13 +289,13 @@ function startServer() { this.server.on( 'error', function(err){ - self.log('server error',err); + this.log('server error',err); - self.publish( + this.publish( 'error', err ); - } + }.bind(this) ); this.server.maxConnections=this.config.maxConnections;