def __init__(self, sock, msg_size, local=True):
        """
        Constructor
        :param sock (`socket.socket`): the socket to be wrapped
        :param msg_size (`int`): the maximal size of the data received by sockets.
        :param local (`boolean`): whether the endpoint is local or not
        """
        self.sock = sock
        self.peer = None  # the other side of the tunnel
        self.event = None  # record the current event (`EVENT_READ` or `EVENT_WRITE`) when the endpoint is polled out.
        self.local = local
        self.stream = b''  # store the bytes read from the sock
        self.msg_size = msg_size
        self.address = None
        self.try_turn = 0
        self.last_active_time = 0
        self.active_queue_index = -1
        self.status = {}
        self.closed = False
def __init__ ( self , sock , msg_size , local = True ) : self . sock = sock self . peer = None self . event = None self . local = local self . stream = b'' self . msg_size = msg_size self . address = None self . try_turn = 0 self . last_active_time = 0 self . active_queue_index = - 1 self . status = { } self . closed = False
Constructor
        :param sock (`socket.socket`): the socket to be wrapped
        :param msg_size (`int`): the maximal size of the data received by sockets.
        :param local (`boolean`): whether the endpoint is local or not