ZeroMQ timeout a REQ/REP connection
来源:互联网 发布:mac chown usr local 编辑:程序博客网 时间:2024/04/29 02:31
import sysimport zmq# None of these operations will block, regardless of peer:context = zmq.Context()socket = context.socket(zmq.REQ)socket.setsockopt(zmq.LINGER, 0)socket.connect("tcp://127.0.0.1:12346")socket.send_json({"msg": "testmsg"}) # send can block on other socket types, so keep track# use poll for timeouts:poller = zmq.Poller()poller.register(socket, zmq.POLLIN)if poller.poll(10*1000): # 10s timeout in milliseconds msg = socket.recv_json()else: raise IOError("Timeout processing auth request")# these are not necessary, but still good practice:socket.close()context.term()sys.exit(0)
- ZeroMQ timeout a REQ/REP connection
- ZeroMQ 之 Rep/Req
- ZeroMQ之REP/REQ模式
- ZeroMQ(java)之异步req/rep
- zeromq源代码分析6-2------REQ和REP
- 005 ZeroMQ REQ-<ROUTER-Dealer>-REP代理应答与请求
- zeroMQ/jzmq REQ/REP(c/s)模式及java代码示例
- ZeroMQ 简单的高性能REP-REQ模型,Java语言版本
- ZeroMQ(java)Socket之Req
- pyzmq提升REQ/REP模式可靠性
- 005 ZeroMQ REQ-<ROUTER-ROUTER>-REQ 路由模式
- ZMQ源码分析(八)--ROUTER-DEALER & REQ-REP
- Connection Timeout和Command Timeout
- Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This ma
- timeout expired.then timeout period elapsed prior to obtaining a connection from the pool.……
- Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.
- Oracle Terminated Connection Timeout
- restemplate设置connection timeout
- python版本OpenCV 2.3 的中文路径
- Windows Server2008中如何关闭internet explorer增强的安全配置?
- iOS UIControl 几个事件的说明
- 快速掌握VMware Workstation(虚拟机)的使用方法
- c# 操作sqlserver
- ZeroMQ timeout a REQ/REP connection
- Linux操作系统中内存buffer和cache的区别
- webGL 投影
- mesh rigidbody drawing
- navigationitem 的titleView
- VC错误处理技术学习:断言(ASSERT)
- 写代码的他妈都是诗人好吧?
- Vtiger CRM 5.3.0 中文版 工作流增强版 视图增强版发布
- IE浏览器上传文件时本地路径变成”C:\fakepath\”的问题