def setup_socket(self):
"""Sets up the ZMQ socket."""
context = zmq.Context()
# The component inheriting from BaseComponent should self.socket.connect
# with the appropriate address.
self.socket = context.socket(zmq.REQ)
# LINGER sets a timeout for socket.send.
self.socket.setsockopt(zmq.LINGER, 0)
# RCVTIME0 sets a timeout for socket.recv.
self.socket.setsockopt(zmq.RCVTIMEO, 500) # milliseconds
core.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录