Skip to content

Loading…

Implement zmq_disconnect #89

Merged
merged 1 commit into from

2 participants

@tchap

Not much more to say... I haven't even tried the code, just to build it, but it's just a copy of Connect and it simply must work ;-)

Signed-off-by: Ondrej Kupka ondra.cap@gmail.com

@tchap tchap Implement zmq_disconnect
Signed-off-by: Ondrej Kupka <ondra.cap@gmail.com>
a973a3c
@alecthomas
Owner

Excellent, thanks!

@alecthomas alecthomas merged commit 62f3d98 into alecthomas:master

1 check passed

Details default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 15, 2013
  1. @tchap

    Implement zmq_disconnect

    tchap committed
    Signed-off-by: Ondrej Kupka <ondra.cap@gmail.com>
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 {
Something went wrong with that request. Please try again.