Permalink
Browse files

Implement zmq_disconnect

Signed-off-by: Ondrej Kupka <ondra.cap@gmail.com>
  • Loading branch information...
1 parent f2e0536 commit a973a3c742e9f49e86d41b6db1343ab72a435394 @tchap tchap committed Aug 15, 2013
Showing with 14 additions and 0 deletions.
  1. +14 −0 zmq_3_x.go
View
@@ -129,6 +129,20 @@ func (s *Socket) SetHWM(value int) error {
return rcv
}
+// Disconnect the socket from the address.
+// int zmq_disconnect (void *s, const char *addr);
+func (s *Socket) Disconnect(address string) error {
+ if s.c == nil {
+ return ENOTSOCK
+ }
+ a := C.CString(address)
+ defer C.free(unsafe.Pointer(a))
+ if rc, err := C.zmq_disconnect(s.s, a); rc != 0 {
+ return casterr(err)
+ }
+ return nil
+}
+
// Send a message to the socket.
// int zmq_send (void *s, zmq_msg_t *msg, int flags);
func (s *Socket) Send(data []byte, flags SendRecvOption) error {

0 comments on commit a973a3c

Please sign in to comment.