|
| constructor (Qore::ZMQ::ZContext ctx, *string identity, string endpoint) |
| constructs a REQ zsocket with an explicit identity and endpoint More...
|
|
| constructor (Qore::ZMQ::ZContext ctx) |
| constructs an unconnected REQ zsocket with a default system-assigned identity More...
|
|
nothing | attach (*string endpoints, bool do_bind=False) |
| Attaches the socket to zero or more endpoints. More...
|
|
int | bind (string format,...) |
| Bind the ZSocket to a formatted endpoint. More...
|
|
nothing | connect (string format,...) |
| Connects the socket to a formatted endpoint. More...
|
|
| copy () |
| Throws an exception; copying ZSocket objects is not currently supported. More...
|
|
nothing | disconnect (string format,...) |
| Disconnects the socket from a formatted endpoint. More...
|
|
*string | endpoint () |
| Returns the last bound endpoint, if any or nothing if not. More...
|
|
*string | getIdentity () |
| retrieves the socket identity string More...
|
|
auto | getOption (int opt, int bufsize=100) |
| Retrieves the value of the given socket option. More...
|
|
nothing | monitor (int events, string format,...) |
| Creates a bound PAIR socket on the given endpoint which will send the specified events to a single client. More...
|
|
ZFrame | recvFrame () |
| Receives a frame from the socket. More...
|
|
ZMsg | recvMsg () |
| Receives a message from the socket. More...
|
|
nothing | send (Qore::ZMQ::ZMsg msg) |
| Sends the given message over the socket; the message is consumed by this call. More...
|
|
nothing | send (Qore::ZMQ::ZFrame frame, int flags=0) |
| Sends the given frame over the socket; the frame is consumed by this call unless Qore::ZMQ::ZFRAME_REUSE is used in the flags argument. More...
|
|
nothing | send (data val,...) |
| Sends one or more strings or binary data objects over the socket. More...
|
|
nothing | send () |
| Sends a zero-length message over the socket. More...
|
|
nothing | setIdentity (string id) |
| Sets the socket identity string. More...
|
|
| setOption (int opt, int value) |
| Sets the given socket option to the given value. More...
|
|
| setOption (int opt, bool value) |
| Sets the given socket option to the given value. More...
|
|
| setOption (int opt, data value) |
| Sets the given socket option to the given value. More...
|
|
nothing | setRecvHighWaterMark (int value) |
| Sets the receive high water mark. More...
|
|
nothing | setRecvTimeout (timeout timeout_ms) |
| Sets the receive timeout in milliseconds. More...
|
|
nothing | setSendTimeout (timeout timeout_ms) |
| Sets the send timeout in milliseconds. More...
|
|
nothing | setTimeout (timeout timeout_ms) |
| Sets the send and receive timeout in milliseconds. More...
|
|
string | type () |
| Returns the socket type as a string. More...
|
|
nothing | unbind (string format,...) |
| Unbinds the socket from a formatted endpoint. More...
|
|
nothing | waitRead (timeout timeout_ms) |
| Waits for data to read on the socket; if data does not arrive before the timeout expires, a ZSOCKET-TIMEOUT-ERROR exception is thrown. More...
|
|
nothing | waitWrite (timeout timeout_ms) |
| Waits for data to be written on the socket; if data is not sent before the timeout expires, a ZSOCKET-TIMEOUT-ERROR exception is thrown. More...
|
|
The ZSocketReq class implements a ZeroMQ REQ
socket.
- Restrictions:
- Qore::PO_NO_NETWORK
- Overview
- A socket of type
REQ
is used by a client to send requests to and receive replies from a service. This socket type allows only an alternating sequence of ZSocket::send*() and subsequent ZSocket::recv*() calls. Each request sent is round-robined among all services, and each reply received is matched with the last issued request.
If no services are available, then any send operation on the socket shall block until at least one service becomes available. The REQ
socket shall not discard messages.
Summary of REQ
characteristics
Property | Value |
Compatible peer sockets | REP, ROUTER |
Direction | Bidirectional |
Send/receive pattern | Send, Receive, Send, Receive, ... |
Outgoing routing strategy | Round-robin |
Incoming routing strategy | Last peer |
Action in mute state | Block |
- Note
- This class is not designed to be accessed from multiple threads; it was created without locking for fast and efficient use when used from a single thread. For methods that would be unsafe to use in another thread, any use of such methods in threads other than the thread where the constructor was called will cause a
ZSOCKET-THREAD-ERROR
to be thrown.
- It is recommended to use an identity with
REQ
sockets