from small one page howto to huge articles all in one place
 

search text in:





Poll
Which screen resolution do you use?










poll results

Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

103483

userrating:

average rating: 1.7 (85 votes) (1=very good 6=terrible)


May 25th. 2007:
Words

486

Views

218153

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

98767

userrating:

average rating: 1.3 (28 votes) (1=very good 6=terrible)


April, 26th. 2006:

Druckversion
You are here: manpages





ZMQ_PROXY

Section: 0MQ Manual (3)
Updated: 10/14/2014
Index Return to Main Contents
 

NAME

zmq_proxy - start built-in 0MQ proxy  

SYNOPSIS

int zmq_proxy (const void *frontend, const void *backend, const void *capture);  

DESCRIPTION

The zmq_proxy() function starts the built-in 0MQ proxy in the current application thread.

The proxy connects a frontend socket to a backend socket. Conceptually, data flows from frontend to backend. Depending on the socket types, replies may flow in the opposite direction. The direction is conceptual only; the proxy is fully symmetric and there is no technical difference between frontend and backend.

Before calling zmq_proxy() you must set any socket options, and connect or bind both frontend and backend sockets. The two conventional proxy models are:

zmq_proxy() runs in the current thread and returns only if/when the current context is closed.

If the capture socket is not NULL, the proxy shall send all messages, received on both frontend and backend, to the capture socket. The capture socket should be a ZMQ_PUB, ZMQ_DEALER, ZMQ_PUSH, or ZMQ_PAIR socket.

Refer to zmq_socket(3) for a description of the available socket types.  

EXAMPLE USAGE

 

Shared Queue

When the frontend is a ZMQ_ROUTER socket, and the backend is a ZMQ_DEALER socket, the proxy shall act as a shared queue that collects requests from a set of clients, and distributes these fairly among a set of services. Requests shall be fair-queued from frontend connections and distributed evenly across backend connections. Replies shall automatically return to the client that made the original request.  

Forwarder

When the frontend is a ZMQ_XSUB socket, and the backend is a ZMQ_XPUB socket, the proxy shall act as a message forwarder that collects messages from a set of publishers and forwards these to a set of subscribers. This may be used to bridge networks transports, e.g. read on tcp:// and forward on pgm://.  

Streamer

When the frontend is a ZMQ_PULL socket, and the backend is a ZMQ_PUSH socket, the proxy shall collect tasks from a set of clients and forwards these to a set of workers using the pipeline pattern.  

RETURN VALUE

The zmq_proxy() function always returns -1 and errno set to ETERM (the 0MQ context associated with either of the specified sockets was terminated).  

EXAMPLE

Creating a shared queue proxy.

//  Create frontend and backend sockets
void *frontend = zmq_socket (context, ZMQ_ROUTER);
assert (backend);
void *backend = zmq_socket (context, ZMQ_DEALER);
assert (frontend);
//  Bind both sockets to TCP ports
assert (zmq_bind (frontend, "tcp://*:5555") == 0);
assert (zmq_bind (backend, "tcp://*:5556") == 0);
//  Start the queue proxy, which runs until ETERM
zmq_proxy (frontend, backend, NULL);

 

SEE ALSO

zmq_bind(3) zmq_connect(3) zmq_socket(3) zmq(7)  

AUTHORS

This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at m[blue]http://www.zeromq.org/docs:contributingm[].


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE USAGE
Shared Queue
Forwarder
Streamer
RETURN VALUE
EXAMPLE
SEE ALSO
AUTHORS


Please read "Why adblockers are bad".



Other free services
toURL.org
Shorten long
URLs to short
links like
http://tourl.org/2
tourl.org
.
Reverse DNS lookup
Find out which hostname(s)
resolve to a
given IP or other hostnames for the server
www.reversednslookup.org
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2017 Sascha Nitsch Unternehmensberatung UG(haftungsbeschränkt)
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 3.4 ms