Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ zmq

npm-debug.log
prebuilds
zmq-build.log
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ os:
osx_image: xcode7.2

env:

matrix:
- NODE_VERSION="6"
global:
Expand All @@ -33,9 +32,8 @@ before_install:
- npm --version
- test "$(uname)" = "Darwin" || export CXX=g++-4.9 CC=gcc-4.9
- gcc --version
- sh build_libzmq.sh

install: env PKG_CONFIG_PATH=$ZMQ_PREFIX/lib/pkgconfig npm install
install: npm install

script: travis_retry npm test

Expand Down
29 changes: 10 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
**zmq-prebuilt**: Your ready to use, prebuilt [ØMQ](http://www.zeromq.org/)
bindings for [Node.js](https://nodejs.org/en/).

0MQ provides handy functionality when working with sockets. Yet,
installing dependencies on your operating system or building 0MQ from
ØMQ provides handy functionality when working with sockets. Yet,
installing dependencies on your operating system or building ØMQ from
source can lead to developer frustration.

**zmq-prebuilt** simplifies creating communications for a Node.js
application by providing well-tested, ready to use 0MQ bindings.
application by providing well-tested, ready to use ØMQ bindings.
zmq-prebuilt supports all major operating systems, including:

* OS X/Darwin 64-bit
Expand Down Expand Up @@ -45,39 +45,30 @@ Now, prepare to be amazed by the wonders of binaries.

## Usage

Replace `require(zmq)` in your code base with `zmq-prebuilt`. That's it.
Replace `require(zmq)` in your code base with `require(zmq-prebuilt)`. That's it.
The wonder of binaries begins.

----

## Installation - Contributors and Development

To set up `zmq-prebuilt` for development, fork this repository and
clone your fork to your system. Be sure you have `git-lfs` installed.
clone your fork to your system. Be sure you have Python 2 and `git-lfs` installed.

### Linux and OS X

*Prerequisites*
**Prerequisites for Linux and OS X**

If you are running on Linux or OS X, you will need to have `automake`,
`autoconf`, `wget` and `libtool` installed. For Linux, use your distribution's
`autoconf`, `pkg-config`, `wget` and `libtool` installed. For Linux, use your distribution's
package manager to install. On OS X, these can be installed using
[Homebrew](http://brew.sh) and using the Homebrew command `brew install`
command. For example, install `wget` with `brew install wget`.

Install a development version of `zmq-prebuilt` with the following:

```bash
./build_libzmq.sh
npm install
```
**Prerequisites for Windows**

### Windows
On Windows you'll need [Visual Studio 2013](https://www.microsoft.com/en-US/download/details.aspx?id=44914).

*Prerequisites*

On Windows you'll need a C++ compiler, preferably
[Visual Studio 2013](https://www.visualstudio.com/downloads/download-visual-studio-vs).
**Installation**

Install a development version of `zmq-prebuilt` with the following:

Expand Down
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
2 changes: 2 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
],
}],
['OS=="mac" or OS=="solaris"', {
'install_zmq': '<!(./build_libzmq.sh 2>&1 > zmq-build.log)',
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'MACOSX_DEPLOYMENT_TARGET': '10.6',
Expand All @@ -36,6 +37,7 @@
['OS=="openbsd" or OS=="freebsd"', {
}],
['OS=="linux"', {
'install_zmq': '<!(./build_libzmq.sh 2>&1 > zmq-build.log)',
'libraries': [ '<(PRODUCT_DIR)/../../zmq/lib/libzmq.a' ],
'include_dirs': [ '<(PRODUCT_DIR)/../../zmq/include' ],
}],
Expand Down
16 changes: 0 additions & 16 deletions build.js

This file was deleted.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@
},
"dependencies": {
"bindings": "~1.2.1",
"in-publish": "^2.0.0",
"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"
},
"scripts": {
"prepublish": "in-publish && node build.js || echo 'Not in npm prepublish.'",
"install": "prebuild --install",
"test": "mocha --expose-gc --slow 300 --timeout 4000"
},
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