Is ZMQ TCP socket different from conventional TCP?
Asked Answered
L

2

7

I am new to ZMQ. I find ZMQ socket implementation much simpler than winsock. But my doubt is that "can a client created using ZMQ TCP socket talk to conventional TCP server?" in other words Can my ZMQ client communicate with a TELNET server implemented using winsock?

Lir answered 26/8, 2014 at 4:49 Comment(2)
Generally, no. Check out the documentation though, as they have a mode where their own protocol is deactivated. They use it to implement HTTP in the example, maybe you could use it to implement the telnet protocol, too. Apropos, WinSock is just a network library that implements several protocols like e.g. TCP, UDP and the underlying IP. The point is that your last words "implemented using WinSock" are irrelevant to answer your question.Amiss
@UlrichEckhardt I got your point. Thank you. Just for an example sake i mentioned winsock.Lir
M
1

No it cannot. ZeroMQ is a messaging library and is not just a pure socket. It uses its own protocol called ZMTP and both endpoints are required to understand it.

Mush answered 26/8, 2014 at 5:21 Comment(2)
This is not correct. Since version 4, over a year old, there's a ZMQ_STREAM socket that supports raw TCP. It works very much like a TCP socket (reading whatever the network delivers), with high-speed async writing, and adding the ZeroMQ abilities such as multiple binds and connects. See api.zeromq.org/4-0:zmq-socket#toc18Devilment
This should no longer be the accepted answer. See https://mcmap.net/q/1533622/-is-zmq-tcp-socket-different-from-conventional-tcp.Lamellar
D
4

Yes you can. It's called a ZMQ_STREAM socket. Documentation is here: zmq_socket.txt

A socket of type ZMQ_STREAM is used to send and receive TCP data from a non-ØMQ peer, when using the tcp:// transport. A ZMQ_STREAM socket can act as client and/or server, sending and/or receiving TCP data asynchronously.

When receiving TCP data, a ZMQ_STREAM socket shall prepend a message part containing the identity of the originating peer to the message before passing it to the application. Messages received are fair-queued from among all connected peers.

When sending TCP data, a ZMQ_STREAM socket shall remove the first part of the message and use it to determine the identity of the peer the message shall be routed to, and unroutable messages shall cause an EHOSTUNREACH or EAGAIN error.

Darwin answered 20/8, 2021 at 9:58 Comment(0)
M
1

No it cannot. ZeroMQ is a messaging library and is not just a pure socket. It uses its own protocol called ZMTP and both endpoints are required to understand it.

Mush answered 26/8, 2014 at 5:21 Comment(2)
This is not correct. Since version 4, over a year old, there's a ZMQ_STREAM socket that supports raw TCP. It works very much like a TCP socket (reading whatever the network delivers), with high-speed async writing, and adding the ZeroMQ abilities such as multiple binds and connects. See api.zeromq.org/4-0:zmq-socket#toc18Devilment
This should no longer be the accepted answer. See https://mcmap.net/q/1533622/-is-zmq-tcp-socket-different-from-conventional-tcp.Lamellar

© 2022 - 2024 — McMap. All rights reserved.