Permalink
Browse files

Merge pull request #89 from tchap/socket-disconnect

Implement zmq_disconnect
  • Loading branch information...
alecthomas committed Sep 12, 2013
2 parents f2e0536 + a973a3c commit 62f3d9826d867e3b77c27a3ff63ba26a293ba18e
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 62f3d98

Please sign in to comment.