ppq

Push/Pull TCP Messaging

ppq

Push/Pull TCP Messaging. Somewhat inspired by punt.

$ npm install ppq

Pull server

var pull = require('ppq/pull')
var server = pull(3000);
 
server.on('message', function (msg) {
  console.log(msg);
});

Push client

var push = require('ppq/push');
var a = push('0.0.0.0:3000');
var b = push('0.0.0.0:3000');
 
setInterval(function () {
  a.send('kinkajou');
}, 500);
 
setInterval(function () {
  b.send('panda');
}, 800);

Returns a readable and writable stream listening on port.

Closes the server listening on port.

Returns a readable and writable stream bound to addr.

Sends an arbitrary message to bound addr.

MIT