示例#1
0
文件: zmq.go 项目: psilva261/gozmq
// 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
}
示例#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
}
示例#3
0
文件: zmq.go 项目: 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
}
示例#4
0
文件: zmq.go 项目: 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
}
示例#5
0
文件: zmq4.go 项目: 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
}
示例#6
0
文件: zmq.go 项目: pakohan/go-zmq
// Closes the socket.
func (s *Socket) Close() {
	C.zmq_close(s.sock)
}
示例#7
0
文件: zmq.go 项目: badgerodon/zmq
func Close(socket ZSocket) os.Error {
	return handle(C.zmq_close(socket.Ptr))
}
示例#8
0
文件: zmq.go 项目: 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)
}