Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added multiple req/rep test

  • Loading branch information...
commit 07e4f9c1e92076e510977159c54213f66c7e500d 1 parent 76ed632
@tj tj authored
Showing with 29 additions and 0 deletions.
  1. +29 −0 test/test.socket.req-rep.multiple.js
View
29 test/test.socket.req-rep.multiple.js
@@ -0,0 +1,29 @@
+
+var zmq = require('../')
+ , should = require('should');
+
+var n = 5;
+
+while (n--) {
+ (function(n){
+ var rep = zmq.socket('rep')
+ , req = zmq.socket('req');
+
+ rep.on('message', function(msg){
+ msg.should.be.an.instanceof(Buffer);
+ msg.toString().should.equal('hello');
+ rep.send('world');
+ });
+
+ rep.bind('inproc://' + n, function(){
+ req.connect('inproc://' + n);
+ req.send('hello');
+ req.on('message', function(msg){
+ msg.should.be.an.instanceof(Buffer);
+ msg.toString().should.equal('world');
+ req.close();
+ rep.close();
+ });
+ });
+ })(n);
+}

0 comments on commit 07e4f9c

Please sign in to comment.
Something went wrong with that request. Please try again.