-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode-program.js
More file actions
32 lines (24 loc) · 756 Bytes
/
node-program.js
File metadata and controls
32 lines (24 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var axon = require('axon')
, sock = axon.socket('pull');
sock.bind(3000);
// sock.connect(3000);
sock.on('message', function(msg){
console.log("************************************");
console.log(msg.toString());
});
var axon = require('axon')
, sockPush = axon.socket('push');
sockPush.connect('tcp://000.000.0.000:3000');
console.log('push server started');
setInterval(function(){
sockPush.send();
console.log("************************************");
console.log("omgz STEPHEN IS PUSHING")
}, 500);
var axon = require('axon')
, sockSub = axon.socket('sub');
sockSub.connect("tcp://000.000.0.00:3000");
sockSub.on('message', function(msg){
console.log("************************************");
console.log(msg.toString());
});