[zeromq-dev] Integrating ZeroMQ into existing systems?

Peter Alexander vel.accel at gmail.com
Mon Jul 12 20:26:06 CEST 2010


On Mon, Jul 12, 2010 at 2:17 PM, Chuck Remes <cremes.devlist at mac.com> wrote:
> On Jul 12, 2010, at 1:04 PM, Peter Alexander wrote:
>
>> On Mon, Jul 12, 2010 at 1:45 PM, Chuck Remes <cremes.devlist at mac.com> wrote:
>>> On Jul 12, 2010, at 12:18 PM, Steven Clark wrote:
>>>
>>>> Forgive me a simple/stupid question here-
>>>>
>>>> To make use of ZeroMQ, do both ends of a simple network connection
>>>> need to be programmed with ZeroMQ, or can one endpoint use ZeroMQ and
>>>> the other use low-level (Berkeley-style) sockets?
>>>>
>>>> I have a situation where a device (microcontroller-based) connects
>>>> periodically to a TCP server, sends/recvs some data, and disconnects.
>>>> The server sends some filtered form of the data to other network
>>>> endpoints. Currently everything is written using low-level sockets.
>>>> I'd like to switch the server to use ZeroMQ so I can take advantage of
>>>> Publisher/Subscriber sockets, etc for the distribution of data from
>>>> the server. Should/can I make the link between the device and the
>>>> server use ZeroMQ, given that I can't exactly port ZeroMQ to run on
>>>> the microcontroller platform?
>>>>
>>>> In the event that I can use it for the device connection, is the PAIR
>>>> topology the correct one to use? What happens if the device doesn't
>>>> shut down the connection cleanly (which happens fairly often)? Is
>>>> there any danger of getting stuck in a FIN_WAIT state?
>>>
>>> You can use regular sockets but you need to conform to the 0mq wire protocol.
>>>
>>> See: http://api.zeromq.org/zmq_tcp.html
>>>
>>> I think you could probably get something working on the microcontroller platform for SUB sockets pretty easily.
>>>
>>
>> Correct me if I'm wrong here.. zmq_poll() can also be used. And I
>> believe Martin is working on making this transparent for the future.
>
> zmq_poll() doesn't help in this situation. He wants to be able to talk to 0mq sockets from a device that does NOT have the 0mq library. To do so, the application logic behind the regular socket will need to "speak" the 0mq wire format.
>

Chuck you know more about this stuff then I do, but if he wanted to,
couldn't he use a standard socket in the 0mq application to
communicate with the with the "foreign" device. Granted zmq_poll()
does add a little more overhead.

zmq_poll(3) states..

"For each zmq_pollitem_t item, zmq_poll() shall examine either the ØMQ
socket referenced by a 0mq socket or a standard socket specified by
the file descriptor fd"

> cr
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list