Upgrade socket.io to 2.x

This commit is contained in:
Jeena 2017-11-06 22:17:33 +01:00
parent 1bb9539530
commit 1df7258b56
6 changed files with 370 additions and 21 deletions

View file

@ -12,7 +12,10 @@ function (io) {
: 0;
this.coordinator = coordinator;
this.socket = io.listen(server);
this.socket = io(server, {
'log level': options.logLevel,
//'transports': ['websockets']
});
this.init(options);
}
@ -20,16 +23,6 @@ function (io) {
Socket.prototype.init = function (options) {
var self = this;
this.socket.configure('development', function () {
this.set('log level', options.logLevel);
this.set('transports', ['websocket']);
});
this.socket.configure('production', function () {
this.set('log level', options.logLevel);
this.set('transports', ['websocket']);
});
this.socket.on('connection', function (user) {
console.checkpoint('socket receiving connection');
self.onConnection(user);