Commit a05984c2 authored by project's avatar project

--no commit message

--no commit message
parent 10d66e4b
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"dependencies": { "dependencies": {
"amqplib": "^0.4.2", "amqplib": "^0.4.2",
"async": "^2.0.1", "async": "^2.0.1",
"axon": "^2.0.3",
"body-parser": "^1.15.2", "body-parser": "^1.15.2",
"bson": "^0.5.6", "bson": "^0.5.6",
"buffalo": "^0.1.3", "buffalo": "^0.1.3",
......
// var axon = require('axon');
// var sock = axon.socket('push');
//
// sock.bind('tcp://0.0.0.0:3333')
// console.log('push server started');
//
// sock.on('disconnect',function(dat){
// console.log(dat._peername);
// })
//
// sock.on('connect',function(dat){
// console.log('connect');
// console.log(dat._peername);
// })
//
//
// var i=0;
// setInterval(function(){
// var t = {'t':'hello','seq':i++}
// sock.send(t);
// }, 1500);
var axon = require('axon');
var sock = axon.socket('rep');
sock.bind('tcp://0.0.0.0:3333')
sock.on('message', function(img, reply){
// resize the image
console.log('receive');
var rep = img;
rep.note = 'rep';
reply(rep);
});
// var axon = require('axon');
// var sock = axon.socket('pull');
//
// sock.connect('tcp://127.0.0.1:3333');
//
// sock.on('message', function(msg){
// console.log(msg);
// });
var axon = require('axon');
var sock = axon.socket('req');
sock.connect('tcp://127.0.0.1:3333');
var img = {
't' : 'hello'
}
sock.send(img, function(res){
console.log(res);
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment