示例#1
0
文件: zmq2.go 项目: carosio/chello
/*
Start built-in ØMQ device

see: http://api.zeromq.org/2-2:zmq-device#toc2
*/
func Device(device Dev, frontend, backend *Socket) error {
	if !(frontend.opened && backend.opened) {
		return ErrorSocketClosed
	}
	_, err := C.zmq_device(C.int(device), frontend.soc, backend.soc)
	return errget(err)
}
示例#2
0
文件: zmq.go 项目: quenel/gozmq
// run a zmq_device passing messages between in and out
func Device(t DeviceType, in, out *Socket) error {
	if rc, err := C.zmq_device(C.int(t), in.apiSocket(), out.apiSocket()); rc != 0 {
		return casterr(err)
	}
	return errors.New("zmq_device() returned unexpectedly.")
}
示例#3
0
文件: zmq.go 项目: psilva261/gozmq
// run a zmq_device passing messages between in and out
func Device(t DeviceType, in, out Socket) error {
	if C.zmq_device(C.int(t), in.apiSocket(), out.apiSocket()) != 0 {
		return errno()
	}
	return errors.New("zmq_device() returned unexpectedly.")
}
示例#4
0
文件: zmq.go 项目: pakohan/go-zmq
// Creates and runs a ZeroMQ Device. See zmq_device(3) for more details.
func Device(deviceType DeviceType, frontend, backend *Socket) {
	C.zmq_device(C.int(deviceType), frontend.sock, backend.sock)
}
示例#5
0
文件: zmq2.go 项目: patrickToca/zmq2
/*
Start built-in ØMQ device

see: http://api.zeromq.org/2-2:zmq-device#toc2
*/
func Device(device Dev, frontend, backend *Socket) error {
	_, err := C.zmq_device(C.int(device), frontend.soc, backend.soc)
	return errget(err)
}
示例#6
0
文件: zmq.go 项目: badgerodon/zmq
func Device(device int, frontend ZSocket, backend ZSocket) os.Error {
	return handle(C.zmq_device(C.int(device), frontend.Ptr, backend.Ptr))
}