Esempio n. 1
0
/*
Start built-in ØMQ proxy

See: http://api.zeromq.org/3-2:zmq-proxy
*/
func Proxy(frontend, backend, capture *Socket) error {
	var capt unsafe.Pointer
	if capture != nil {
		capt = capture.soc
	}
	_, err := C.zmq_proxy(frontend.soc, backend.soc, capt)
	return errget(err)
}
Esempio n. 2
0
// run a zmq_proxy with in, out and capture sockets
func Proxy(in, out, capture *Socket) error {
	var c unsafe.Pointer
	if capture != nil {
		c = capture.apiSocket()
	}
	if rc, err := C.zmq_proxy(in.apiSocket(), out.apiSocket(), c); rc != 0 {
		return casterr(err)
	}
	return errors.New("zmq_proxy() returned unexpectedly.")
}
Esempio n. 3
0
File: zmq4.go Progetto: gallir/zmq4
/*
Start built-in ØMQ proxy

See: http://api.zeromq.org/4-1:zmq-proxy#toc2
*/
func Proxy(frontend, backend, capture *Socket) error {
	if !(frontend.opened && backend.opened && (capture == nil || capture.opened)) {
		return ErrorSocketClosed
	}
	var capt unsafe.Pointer
	if capture != nil {
		capt = capture.soc
	}
	_, err := C.zmq_proxy(frontend.soc, backend.soc, capt)
	return errget(err)
}
Esempio n. 4
0
// run a zmq_proxy with in, out and capture sockets
func Proxy(in, out, capture Socket) error {
	if C.zmq_proxy(in.apiSocket(), out.apiSocket(), capture.apiSocket()) != 0 {
		return errno()
	}
	return errors.New("zmq_proxy() returned unexpectedly.")
}
Esempio n. 5
0
// run a zmq_proxy with in, out and capture sockets
func Proxy(in, out, capture Socket) error {
	if rc, err := C.zmq_proxy(in.apiSocket(), out.apiSocket(), capture.apiSocket()); rc != 0 {
		return casterr(err)
	}
	return errors.New("zmq_proxy() returned unexpectedly.")
}