Add ZeroMQ unbind function types

This commit is contained in:
Panu Horsmalahti
2015-02-04 15:30:53 +02:00
parent 1a90640f3a
commit 597795c538
2 changed files with 21 additions and 0 deletions
+4
View File
@@ -5,6 +5,7 @@ import zmq = require('zmq');
function test1() {
var sock = zmq.socket('push');
sock.bindSync('tcp://127.0.0.1:3000');
sock.unbindSync('tcp://127.0.0.1:3000');
sock.send("some work");
}
@@ -28,6 +29,9 @@ function test4() {
sock.bind('tcp://127.0.0.1', err => {
sock.send("some work");
});
sock.unbind('tcp://127.0.0.1', err => {
//
});
}
function test5() {
+17
View File
@@ -94,6 +94,23 @@ declare module 'zmq' {
*/
bindSync(addr: string): Socket;
/**
* Async unbind.
*
* Emits the "unbind" event.
*
* @param addr Socket address
* @param cb Unind callback
*/
unbind(addr: string, callback: (error: string) => void ): Socket;
/**
* Sync unbind.
*
* @param addr Socket address
*/
unbindSync(addr: string): Socket;
/**
* Connect to `addr`.
*