ZMQ REP Message Sink: Difference between revisions
(add example flowgraph) |
(add information about Zeromq restrictions) |
||
Line 1: | Line 1: | ||
[[Category:Block Docs]] | [[Category:Block Docs]] | ||
The ZMQ REP Message Sink block receives async messages and sends them to a ZMQ REP socket. This block will connect to a ZMQ REQ Message Source <b>only</b>. | The ZMQ REP Message Sink block receives async messages and sends them to a ZMQ REP socket. This block will connect to a ZMQ REQ Message Source <b>only</b>.<br> | ||
The zeromq.org website says:<br> | |||
"The REQ-REP socket pair is in lockstep. The client issues zmq_send() and then zmq_recv(), in a loop (or once if that's all it needs). Doing any other sequence (e.g., sending two messages in a row) will result in a return code of -1 from the send or recv call. Similarly, the service issues zmq_recv() and then zmq_send() in that order, as often as it needs to."<br> | |||
That happens on a single port. Apparently the gr-zeromq implementation of ZMQ REQ Message Source and ZMQ REP Message Sink do not require that message flow. On a flowgraph, a message feed such as a Message Strobe block can send to a ZMQ REP Message Sink on a continuous basis. Similarly, a ZMQ REQ Message Source can receive a continuous succession of messages with no errors.<br> | |||
Because of the zeromq.org restriction, apparently there is no way an external process can communicate with the GR implementation. | |||
== Parameters == | == Parameters == |
Revision as of 16:48, 10 March 2020
The ZMQ REP Message Sink block receives async messages and sends them to a ZMQ REP socket. This block will connect to a ZMQ REQ Message Source only.
The zeromq.org website says:
"The REQ-REP socket pair is in lockstep. The client issues zmq_send() and then zmq_recv(), in a loop (or once if that's all it needs). Doing any other sequence (e.g., sending two messages in a row) will result in a return code of -1 from the send or recv call. Similarly, the service issues zmq_recv() and then zmq_send() in that order, as often as it needs to."
That happens on a single port. Apparently the gr-zeromq implementation of ZMQ REQ Message Source and ZMQ REP Message Sink do not require that message flow. On a flowgraph, a message feed such as a Message Strobe block can send to a ZMQ REP Message Sink on a continuous basis. Similarly, a ZMQ REQ Message Source can receive a continuous succession of messages with no errors.
Because of the zeromq.org restriction, apparently there is no way an external process can communicate with the GR implementation.
Parameters
(R): Run-time adjustable
- Address
- ZMQ socket address specifier. The format of the address is
tcp://*:port
where * should be 127.0.0.1 for localhost.
- Timeout
- Socket timeout in milliseconds, default is 100ms.
Example Flowgraph
Source Files
- C++ files
- TODO
- Header files
- TODO
- Public header files
- TODO
- Block definition
- TODO