Skip to content

Commit

Permalink
Merge pull request #54 from lgeiger/sync-upstream
Browse files Browse the repository at this point in the history
Sync with upstream JustinTulloss/zeromq.node
  • Loading branch information
rgbkrk authored Oct 6, 2016
2 parents 587c1d7 + d48513e commit 1bfd207
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 2 additions & 0 deletions binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,9 @@ namespace zmq {
opts_binary.insert(48); // ZMQ_CURVE_PUBLICKEY
opts_binary.insert(49); // ZMQ_CURVE_SECRETKEY
opts_binary.insert(50); // ZMQ_CURVE_SERVERKEY
opts_int.insert(51); //ZMQ_PROBE_ROUTER
opts_binary.insert(55); // ZMQ_ZAP_DOMAIN
opts_int.insert(66); //ZMQ_HANDSHAKE_IVL
#endif

NODE_DEFINE_CONSTANT(target, ZMQ_CAN_DISCONNECT);
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
},
"dependencies": {
"bindings": "~1.2.1",
"nan": "~2.4.0",
"nan": "^2.4.0",
"prebuild": "^4.2.2"
},
"devDependencies": {
"mocha": "~1.13.0",
"semver": "~4.1.1",
"should": "2.1.x"
"mocha": "^3.1.0",
"semver": "^5.3.0",
"should": "^11.1.0"
},
"engines": {
"node": ">=0.8"
Expand Down
13 changes: 4 additions & 9 deletions test/socket.monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ describe('socket.monitor', function() {

it('should be able to monitor the socket', function(done) {
var rep = zmq.socket('rep')
, req = zmq.socket('req')
, events = [];
, req = zmq.socket('req');

rep.on('message', function(msg){
msg.should.be.an.instanceof(Buffer);
Expand All @@ -25,14 +24,10 @@ describe('socket.monitor', function() {
// Test the endpoint addr arg
event_endpoint_addr.toString().should.equal('tcp://127.0.0.1:5423');

// If this is a disconnect event we can now close the rep socket
if (e === 'disconnect') {
rep.close();
}

testedEvents.pop();
if (testedEvents.length === 0) {
rep.unmonitor();
rep.close();
done();
}
});
Expand Down Expand Up @@ -62,7 +57,7 @@ describe('socket.monitor', function() {

// We will try to connect to a non-existing server, zmq will issue events: "connect_retry", "close", "connect_retry"
// The connect_retry will be issued immediately after the close event, so we will measure the time between the close
// event and connect_retry event, those should >= 10 (this will tell us that we are reading 1 event at a time from
// event and connect_retry event, those should >= 9 (this will tell us that we are reading 1 event at a time from
// the monitor socket).

var closeTime;
Expand All @@ -74,7 +69,7 @@ describe('socket.monitor', function() {
var diff = Date.now() - closeTime;
req.unmonitor();
req.close();
diff.should.be.within(10, 20);
diff.should.be.within(9, 20);
done();
});

Expand Down

0 comments on commit 1bfd207

Please sign in to comment.