Skip to content

plediii/dual-clientpool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED Incompatible with dualapi 1.x.

Client pool for dualapi.

Extends a dualapi domain with a multiplexer for socket.io connections.

Connecting

Given a dualapi domain

var domain = dualapi();

Extend the domain with the connect method:

var clientpool = require('dual-clientpool');
domain = clientpool(domain, ['ready']);

When a client connects, connect the socket to the domain:

io.listen().on('connect', function (socket) {
    domain.connect(socket);
});

Connection response

The client is given a unique mount point in the domain such as ['client', xxxxx], where xxxxx is a unique id. The server then sends ['ready'], to the ['index'] host on the client.

Disconnect

When the client disconnects, a message is sent to ['disconnect', 'client', xxxxx] on the server.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published