server/wspool.js
function ( name, socket ) {
		var self = this;

		// check input
		if ( name && socket ) {
			log('ws', 'init', name, 'connection');

			// main data structure
			pool[name] = {
				socket: socket,
				time: +new Date(),
				count: 0,
				active: true
			};

			// disable link on close
			pool[name].socket.on('close', function () {
				self.remove(name);
			});

			// await for an answer
			pool[name].socket.on('message', function ( message ) {
				// has link to talk back
				if ( pool[name].response ) {
					log('ws', 'get', name, message);
					pool[name].response.end(message);
				}
			});
			return true;
		}

		// failure
		log('ws', 'init', name, 'fail to connect (wrong name or link)');
		return false;
	}
function ( name, socket ) {
		var self = this;

		// check input
		if ( name && socket ) {
			log('ws', 'init', name, 'connection');

			// main data structure
			pool[name] = {
				socket: socket,
				time: +new Date(),
				count: 0,
				active: true
			};

			// disable link on close
			pool[name].socket.on('close', function () {
				self.remove(name);
			});

			// await for an answer
			pool[name].socket.on('message', function ( message ) {
				// has link to talk back
				if ( pool[name].response ) {
					log('ws', 'get', name, message);
					pool[name].response.end(message);
				}
			});
			return true;
		}

		// failure
		log('ws', 'init', name, 'fail to connect (wrong name or link)');
		return false;
	}
function ( name , socket ) { var self = this ; // check input if ( name && socket ) { log ( 'ws' , 'init' , name , 'connection' ) ; // main data structure pool [ name ] = { socket : socket , time : + new Date ( ) , count : 0 , active : true } ; // disable link on close pool [ name ] . socket . on ( 'close' , function ( ) { self . remove ( name ) ; } ) ; // await for an answer pool [ name ] . socket . on ( 'message' , function ( message ) { // has link to talk back if ( pool [ name ] . response ) { log ( 'ws' , 'get' , name , message ) ; pool [ name ] . response . end ( message ) ; } } ) ; return true ; } // failure log ( 'ws' , 'init' , name , 'fail to connect (wrong name or link)' ) ; return false ; }
New WebSocket creation.

@param {String} name unique identifier for session
@param {Object} socket websocket resource
@return {Boolean} true if was deleted successfully
New WebSocket creation .