Socket
Book a DemoInstallSign in
Socket

client-manager

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

client-manager

A really simple script to manage clients

latest
Source
npmnpm
Version
0.0.2-3
Version published
Maintainers
3
Created
Source

Client-manager

A really simple script to manage clients

Installation

npm install client-manager

Usage

var io = require('socket.io');
var clientManager = require('client-manager');

var io = require('socket.io').listen(80);

var manager = clientManager();

io.sockets.on('connection', function (socket) {
	
	manager.addClient(socket.id,socket);

	socket.on('disconnect', function () {
		manager.removeClient(socket.id);
	});

});

manager.on('add',function(client) {
	console.log('A client as been added');
});

manager.on('empty',function(client) {
	console.log('There is no more clients');
});

Keywords

clients

FAQs

Package last updated on 10 Dec 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts