首页 > 其他 > 详细

ZeroMQ的笔迹

时间:2015-04-18 01:16:01      阅读:236      评论:0      收藏:0      [点我收藏+]


SUB端口可以连接多个PUB端口

context = zmq.Context()
socket = context.socket(zmq.SUB)

print("Collecting updates from weather server...")
socket.connect("tcp://localhost:5666")
socket.connect("tcp://localhost:5667")
#socket.close() # 可以根据需要关闭连接

 context is the container for all sockets in a single process, and acts as the transport for inproc sockets, which are the fastest way to connect threads in one process.

Call zmq_ctx_new() once at the start of a process, and zmq_ctx_destroy() once at the end.


问题:

  如果写错了对端地址,根本不知道。


ZeroMQ的笔迹

原文:http://my.oschina.net/cppblog/blog/403236

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!