Example #1
0
// Shutdown the socket.
// int zmq_close (void *s);
func (s *zmqSocket) Close() error {
	if C.zmq_close(s.s) != 0 {
		return errno()
	}
	s.c = nil
	return nil
}
Example #2
0
// If not called explicitly, the socket will be closed on garbage collection
func (soc *Socket) Close() error {
	if i, err := C.zmq_close(soc.soc); int(i) != 0 {
		return errget(err)
	}
	soc.soc = unsafe.Pointer(nil)
	return nil
}
Example #3
0
File: zmq.go Project: hlife/gozmq
// Shutdown the socket.
// int zmq_close (void *s);
func (s *zmqSocket) Close() error {
	if rc, err := C.zmq_close(s.s); rc != 0 {
		return casterr(err)
	}
	s.c = nil
	return nil
}
Example #4
0
File: zmq.go Project: quenel/gozmq
// Shutdown the socket.
// int zmq_close (void *s);
func (s *Socket) Close() error {
	if s.c == nil {
		return ENOTSOCK
	}
	if rc, err := C.zmq_close(s.s); rc != 0 {
		return casterr(err)
	}
	s.c = nil
	return nil
}
Example #5
0
File: zmq4.go Project: gallir/zmq4
// If not called explicitly, the socket will be closed on garbage collection
func (soc *Socket) Close() error {
	if soc.opened {
		soc.opened = false
		if i, err := C.zmq_close(soc.soc); int(i) != 0 {
			soc.err = errget(err)
		}
		soc.soc = unsafe.Pointer(nil)
		soc.ctx = nil
	}
	return soc.err
}
Example #6
0
// Closes the socket.
func (s *Socket) Close() {
	C.zmq_close(s.sock)
}
Example #7
0
func Close(socket ZSocket) os.Error {
	return handle(C.zmq_close(socket.Ptr))
}
Example #8
0
File: zmq.go Project: miffa/gozero
// Closes this socket
//
// Expects the executing go routine to still be locked onto an OSThread.
// May be called only once
func (p lzmqSocket) Close() os.Error {
	return p.Provider().OkIf(C.zmq_close(unsafe.Pointer(p)) == 0)
}