Beispiel #1
0
/*
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)
}
Beispiel #2
0
// 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.")
}
Beispiel #3
0
// 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.")
}
Beispiel #4
0
// 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)
}
Beispiel #5
0
/*
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)
}
Beispiel #6
0
func Device(device int, frontend ZSocket, backend ZSocket) os.Error {
	return handle(C.zmq_device(C.int(device), frontend.Ptr, backend.Ptr))
}