mirror of
https://github.com/zeromq/libzmq.git
synced 2025-09-27 16:29:34 +02:00
new zmq_proxy is zmq_proxy_steerable to respect C API
This commit is contained in:
parent
1b75d1ecb5
commit
e33a382f8d
@ -395,7 +395,8 @@ ZMQ_EXPORT int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout);
|
||||
|
||||
/* Built-in message proxy (3-way) */
|
||||
|
||||
ZMQ_EXPORT int zmq_proxy (void *frontend, void *backend, void *capture, void *control);
|
||||
ZMQ_EXPORT int zmq_proxy (void *frontend, void *backend, void *capture);
|
||||
ZMQ_EXPORT int zmq_proxy_steerable (void *frontend, void *backend, void *capture, void *control);
|
||||
|
||||
/* Encode a binary key as printable text using ZMQ RFC 32 */
|
||||
ZMQ_EXPORT char *zmq_z85_encode (char *dest, uint8_t *data, size_t size);
|
||||
|
14
src/zmq.cpp
14
src/zmq.cpp
@ -1016,7 +1016,19 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
|
||||
|
||||
// The proxy functionality
|
||||
|
||||
int zmq_proxy (void *frontend_, void *backend_, void *capture_, void *control_)
|
||||
int zmq_proxy (void *frontend_, void *backend_, void *capture_)
|
||||
{
|
||||
if (!frontend_ || !backend_) {
|
||||
errno = EFAULT;
|
||||
return -1;
|
||||
}
|
||||
return zmq::proxy (
|
||||
(zmq::socket_base_t*) frontend_,
|
||||
(zmq::socket_base_t*) backend_,
|
||||
(zmq::socket_base_t*) capture_);
|
||||
}
|
||||
|
||||
int zmq_proxy_steerable (void *frontend_, void *backend_, void *capture_, void *control_)
|
||||
{
|
||||
if (!frontend_ || !backend_) {
|
||||
errno = EFAULT;
|
||||
|
@ -149,7 +149,7 @@ server_task (void *ctx)
|
||||
threads[thread_nbr] = zmq_threadstart (&server_worker, ctx);
|
||||
|
||||
// Connect backend to frontend via a proxy
|
||||
zmq_proxy (frontend, backend, NULL, control);
|
||||
zmq_proxy_steerable (frontend, backend, NULL, control);
|
||||
|
||||
for (thread_nbr = 0; thread_nbr < QT_WORKERS; thread_nbr++)
|
||||
zmq_threadclose (threads[thread_nbr]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user