1.0.0 • Published 7 years ago

multi-connect v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

example create server

let con = new Connect();
con.createServer({port: 3000});

let clients = [], id = 1;
con.on('connected', (client) => {
    client.id = ++id;
    client.on('disconnect', (id, smooth) => {
        console.log('..... disconnect ......', id);
        console.log('..... smooth ......', smooth);
    }).on('data', data => {
        console.log('..... data ......', data);
    });
    clients.push(client);
});