Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed bindSync
  • Loading branch information
jeremybarnes committed Apr 12, 2011
1 parent 7f745e7 commit dec5bc8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion binding.cc
Expand Up @@ -486,7 +486,7 @@ Handle<Value> Socket::BindSync(const Arguments &args) {

socket->state_ = STATE_BUSY;

if (zmq_bind(socket, *addr) < 0)
if (zmq_bind(socket->socket_, *addr) < 0)
return ThrowException(ExceptionFromError());

socket->state_ = STATE_READY;
Expand Down
10 changes: 8 additions & 2 deletions test/stress_buffer.js
Expand Up @@ -87,9 +87,15 @@ function onBindDone()
intervalId = setInterval(onTick, 1);
}

sock2.bind(uri, onBindDone);

var doSync = true;

if (doSync) {
sock2.bindSync(uri);
onBindDone();
}
else {
sock2.bind(uri, onBindDone);
}


var suite = vows.describe('ZeroMQ');
Expand Down
2 changes: 0 additions & 2 deletions zeromq.js
Expand Up @@ -109,7 +109,6 @@ Socket.prototype.bind = function(addr, cb) {
});
};

/* Currently buggy.
Socket.prototype.bindSync = function(addr) {
var self = this;
self._watcher.stop();
Expand All @@ -121,7 +120,6 @@ Socket.prototype.bindSync = function(addr) {
}
self._watcher.start();
};
*/

Socket.prototype.connect = function(addr) {
this._zmq.connect(addr);
Expand Down

0 comments on commit dec5bc8

Please sign in to comment.