TCP Socket和ZeroMQ socket的区别

来源:互联网 发布:北京飞客数据恢复中心 编辑:程序博客网 时间:2024/06/05 05:51

• ZeroMQ sockets are asynchronous.

zmq套接字是异步的


• They may implement particular patterns.

可以实现特定模式


• TCP sockets are one-to-one whereas ZeroMQ sockets are many-to-many.
However, you could implement one-to-many, one-to-one, many-to-one, or

many-to-many with ZeroMQ, depending on your needs and socket type.

TCP是一对一,ZeroMQ是多对多的,可以根据套接字类型实现一对多,一对一,多对一,或多对多


• ZeroMQ sockets transmit messages whereas TCP transmit bytes. As we said

in Chapter 1, Getting Started, a message is a fixed-length binary object.

ZeroMQ传输消息,TCP传输字节


• I/O is done in the background in ZeroMQ sockets. Even if your application

is too busy to handle messages, they are put in queues.

ZeroMQ 隐藏IO细节


• Unlike TCP, ZeroMQ sockets do not care whether the destination exists
or not.

ZeroMQ不在乎目的是否存在


• ZeroMQ sockets may transmit data to multiple nodes and receive data from
multiple nodes.

ZeroMQ可以往多个节点发送数据,可以从多个节点接收数据

0 0