Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #89 from tchap/socket-disconnect

Implement zmq_disconnect
  • Loading branch information...
commit 62f3d9826d867e3b77c27a3ff63ba26a293ba18e 2 parents f2e0536 + a973a3c
@alecthomas authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 zmq_3_x.go
View
14 zmq_3_x.go
@@ -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 {
Please sign in to comment.
Something went wrong with that request. Please try again.