def __init__(self, engine, server, addr, backlog):
        Server.__init__(self, engine=engine)
        self.server = server

        # Now, listen our way.
        if server._socket.family == socket.AF_INET6:
            family = socket.AF_INET
        else:
            family = socket.AF_INET6

        sock = socket.socket(family, socket.SOCK_STREAM)
        self._socket_set(sock)
        self.engine.add_channel(self)

        try:
            self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
            self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
        except __HOLE__:
            pass

        try:
            self._socket_bind(addr)
            self._socket_listen(backlog)
        except socket.error as err:
            self.close()
            raise

        self._remote_address = None
        self._local_address = None

        self.listening = True

        self.on_accept = self.server.on_accept
dataset/ETHPy150Open ecdavis/pants/pants/server.py/_SlaveServer.__init__