Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use ZeroMQ for raw UDP?

Tags:

zeromq

udp

I have a client, whose code I can't change -- but I'd like to (re)write using ZeroMQ sockets.

The clients use both raw TCP and raw UDP sockets.

I know I can use ZMQ_ROUTER_RAW for raw TCP sockets, but what about for raw UDP datastreams?

like image 591
FreeMemory Avatar asked May 23 '14 09:05

FreeMemory


People also ask

Does ZeroMQ support UDP?

UDP transport can only be used with the ZMQ_RADIO and ZMQ_DISH socket types.

Does ZeroMQ use TCP or UDP?

ZeroMQ sockets carry messages, like UDP, rather than a stream of bytes as TCP does. A ZeroMQ message is length-specified binary data.

What protocol does ZeroMQ use?

ZeroMQ implements ZMTP, the ZeroMQ Message Transfer Protocol. ZMTP defines rules for backward interoperability, extensible security mechanisms, command and message framing, connection metadata, and other transport-level functionality.

Does ZeroMQ use sockets?

ZeroMQ patterns are implemented by pairs of sockets with matching types. The built-in core ZeroMQ patterns are: Request-reply, which connects a set of clients to a set of services. This is a remote procedure call and task distribution pattern.


2 Answers

UDP Support for ZMQ is now documented here: http://api.zeromq.org/master:zmq-udp

Pyzmq version 18 has it as well, stating: "Protocols supported include tcp, udp, pgm, epgm, inproc and ipc." That said, my experimentation with Python hasn't found a solution that works yet. I get "protocol is not compatible with socket type" errors.

like image 144
PfunnyGuy Avatar answered Oct 05 '22 23:10

PfunnyGuy


Support for UDP in ZeroMQ is brand new. The documentation for the new socket types (Radio/Dish) was just pushed to the GitHub repository a few days ago. As of right now, though, it still looks like there's no raw UDP support, but perhaps it will stem out of this new functionality.

I'd recommend commenting on the existing thread about adding UDP support: https://github.com/zeromq/libzmq/issues/807 .

like image 44
Hank Schultz Avatar answered Oct 06 '22 01:10

Hank Schultz