lib/socket/SocketServer.js
function SocketServer() {

  Object.defineProperties(this, {

    /**
     * The Socket.io server.
     *
     * @property io
     * @type Server
     */
    io: {value: null, writable: true},

    /**
     * The list of namespaces added to the server indexed by names.
     *
     * @property namespaces
     * @type Object
     */
    namespaces: {value: {}}

  });

}
function SocketServer() {

  Object.defineProperties(this, {

    /**
     * The Socket.io server.
     *
     * @property io
     * @type Server
     */
    io: {value: null, writable: true},

    /**
     * The list of namespaces added to the server indexed by names.
     *
     * @property namespaces
     * @type Object
     */
    namespaces: {value: {}}

  });

}
function SocketServer ( ) { Object . defineProperties ( this , { /**
     * The Socket.io server.
     *
     * @property io
     * @type Server
     */ io : { value : null , writable : true } , /**
     * The list of namespaces added to the server indexed by names.
     *
     * @property namespaces
     * @type Object
     */ namespaces : { value : { } } } ) ; }
Defines a SocketServer around a socket.io server.

Creating a server using socket.io can't be done without launching the server
and start listening to messages. SocketServer helps creating a socket server
and add namespaces to it without starting the server.

var openVeoApi = require('@openveo/api');
var namespace1 = new openVeoApi.socket.SocketNamespace();
var namespace2 = new openVeoApi.socket.SocketNamespace();
var server = new openVeoApi.socket.SocketServer();

// Listen to a message on first namespace
namespace1.on('namespace1.message', function() {
console.log('namespace1.message received');
});

// Listen to a message on second namespace
namespace2.on('namespace2.message', function() {
console.log('namespace2.message received');
});

// Add namespace1 to the server
server.addNamespace('/namespace1', namespace1);

// Start server
server.listen(80, function() {
console.log('Socket server started');
namespace.emit('namespace1.message');

// Adding a namespace after the server is started will also work
server.addNamespace('/namespace2', namespace2);
namespace2.emit('namespace2.message');
});

@class SocketServer
@constructor
Defines a SocketServer around a socket . io server .