def __init__(self, server_queue, client_queue):
"""Create a new protocol.
:code:`server_queue` and :code:`client_queue` corresponds to the variables
in the TCP proxy.
:code:`self.wait_queue` is used to handle the race condition where
:code:`self.client_queue` is ready to be consumed, but the connection has
not been established.
:param DeferredQueue server_queue:
:param DeferredQueue client_queue:
"""
self.server_queue = server_queue
self.client_queue = client_queue
self.wait_queue = DeferredQueue()
self.client_queue.get().addCallback(self.clientQueueCallback)
评论列表
文章目录