A socket of type ZMQ_SUB, used by a subscriber to subscribe to data
distributed by a publisher. Initially a ZMQ_SUB socket is not subscribed
to any messages, use the ZMQ_SUBSCRIBE option of zmq_setsockopt(3) to
specify which messages to subscribe to.
Table 6. Summary of ZMQ_SUB characteristics Compatible peer sockets
ZMQ_PUB
Build a FAST_ARRAY of STRINGs from a_pointer which must be of a
NULL-terminated array of C strings, that is a "char**" String
contents and array itself are copied.
Operation not supported on socket (POSIX.1) (ENOTSUP and EOPNOTSUPP have the same value on Linux, but according to POSIX.1 these error values should be distinct.)
ZMQ_SUBSCRIBE: Establish message filter
The ZMQ_SUBSCRIBE option shall establish a new message filter on a ZMQ_SUB socket.
Newly created ZMQ_SUB sockets shall filter
out all incoming messages, therefore you should call this option to establish an initial message filter.
An empty option_value of length zero shall subscribe to all incoming messages. A non-empty option_value shall subscribe to all
messages beginning with the specified prefix. Multiple filters may be attached to a single ZMQ_SUB socket, in which case a
message shall be accepted if it matches at least one filter.
Option value type binary data
Option value unit N/A
Default value N/A
Applicable socket types ZMQ_SUB
Receive an eventual incoming message from Current socket, putting it
into a_message; this command does not block.
is_successful and errno are updated.
After this command when is_successful is True a_message will
contain the received message; otherwise errno (from ERRNO) will be
eagain.
Wait until an incoming message in received by Current socket, putting it
into a_message; this command blocks until a_message is received.
is_successful and errno are updated.
After this command when is_successful is True a_message will
contain the received message; otherwise errno (from ERRNO) will be
eagain.
Possible errors
eagain: Non-blocking mode was requested and no messages are available at the moment.
enotsup: The receive operation is not supported by this socket type.
efsm: the receive operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP_SOCKET. See the messaging patterns section of
zmq_socket(3) for more information.
ETERM
The 0MQ context associated with the specified socket was terminated.
ENOTSOCK
The provided socket was invalid.
EINTR
The operation was interrupted by delivery of a signal before a message was available.
EFAULT
The message passed to the function was invalid.
The zmq_bind() function shall create an endpoint for accepting connections and bind it to the socket referenced by the socket
argument.
The endpoint argument is a string consisting of two parts as follows: transport://address. The transport part specifies the
underlying transport protocol to use. The meaning of the address part is specific to the underlying transport protocol
selected.
The following transports are defined:
inproc
local in-process (inter-thread) communication transport, see zmq_inproc(7)
ipc
local inter-process communication transport, see zmq_ipc(7)
tcp
unicast transport using TCP, see zmq_tcp(7)
pgm, epgm
reliable multicast transport using PGM, see zmq_pgm(7)
With the exception of ZMQ_PAIR sockets, a single socket may be connected to multiple endpoints using zmq_connect(), while
simultaneously accepting incoming connections from multiple endpoints bound to the socket using zmq_bind(). Refer to
zmq_socket(3) for a description of the exact semantics involved when connecting or binding a socket to multiple endpoints.
Connect Current socket to the endpoint specified by an_address.
an_address consists of two parts as follows: transport://address.
The transport part specifies the underlying transport protocol to
use. The meaning of the address part is specific to the underlying
transport protocolselected.
The following transports are defined:
inproc: local in-process (inter-thread) communication transport, see zmq_inproc(7) manpage
ipc: local inter-process communication transport, see zmq_ipc(7) manpage
tcp: unicast transport using TCP, see zmq_tcp(7) manpage.
pgm, epgm: reliable multicast transport using PGM, see zmq_pgm(7)
With the exception of ZMQ_PAIR sockets, a single socket may be
connected to multiple endpoints using connect, while
simultaneously accepting incoming connections from multiple
endpoints bound to the socket using bind. See each effective heirs
of ZMQ_SOCKET and creation procedures in ZMQ_CONTEXT for a
description of the exact semantics involved when connecting or
binding a socket to multiple endpoints.
Note: The connection will not be performed immediately but as needed
by 0MQ. Thus a successful invocation of connect does not indicate
that a physical connection was or can actually be established.
This exception occurs when Void is passed as the expression
to inspect ("inspect on STRING only).
This exception also occurs when the inspected value selects no branch (when the keyword "else"
not used, one "when" branch _must_ be selected). Some value which is not one of the inspect
constants, if there is no Else_part
Build a FAST_ARRAY of STRINGs from a_pointer which must be of a
NULL-terminated array of C strings, that is a "char**" String
contents and array itself are copied.
Operation not supported on socket (POSIX.1) (ENOTSUP and EOPNOTSUPP have the same value on Linux, but according to POSIX.1 these error values should be distinct.)