JustinTulloss/zeromq.node — Issue #96: req/rep example not working, if transport is  changed to tcp
Author: mindreframer
Created: 2012-03-03 03:39:49+00:00
State: open

i could not get any req/rep from zguide to work.. so pocking in the test folder, tried the example down below:

is this expected behaviour? or is it a bug?

SPECS:
Mac OSX 10.6.6
node -v
v0.6.8
> zmq = require('zmq').zmqVersion()
'2.1.11'

brew list zeromq
/usr/local/Cellar/zeromq/2.1.11/include/ (3 files)
/usr/local/Cellar/zeromq/2.1.11/lib/libzmq.1.dylib
/usr/local/Cellar/zeromq/2.1.11/lib/pkgconfig/libzmq.pc
/usr/local/Cellar/zeromq/2.1.11/lib/ (2 other files)
/usr/local/Cellar/zeromq/2.1.11/share/man/ (30 files)

```javascript

var zmq = require('zmq');

// var socketAddress = "inproc://stuff" // THIS works!
var socketAddress = "tcp://localhost:5563" // THIS does not...

var rep = zmq.socket('rep')
, req = zmq.socket('req');

rep.on('message', function(msg){
console.log(msg.toString());
rep.send('world');
});

rep.bind(socketAddress);

rep.on('bind', function(){
req.connect(socketAddress);
req.send('hello');
req.on('message', function(msg){
console.log(msg.toString());
req.close();
rep.close();
});
});

```