def __init__(self, bootstrap, timeout=60, debug=False, token=None):
        self.debug = debug
        self.timeout = timeout
        self.domainname = None
        self.token = token
        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1)
        self.socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
        self.socket.setblocking(1)
        self.writelock = Lock()

        self.bootstraplist = self.discoverbootstrap(bootstrap)
        if len(self.bootstraplist) == 0:
            raise ConnectionError("No bootstrap found")
        if not self.connecttobootstrap():
            raise ConnectionError("Cannot connect to any bootstrap")
        myaddr = findOwnIP()
        myport = self.socket.getsockname()[1]
        self.me = Peer(myaddr, myport, NODE_CLIENT)
        self.commandnumber = random.randint(1, sys.maxint)

        # synchronization
        self.lock = Lock()
        self.pendingops = {}  # pending requests indexed by commandnumber
        self.doneops = {}  # requests that are finalized, indexed by command number

        # spawn thread, invoke recv_loop
        try:
            recv_thread = Thread(target=self.recv_loop, name='ReceiveThread')
            recv_thread.daemon = True
            recv_thread.start()
        except (__HOLE__, SystemExit):
            self._graceexit()
dataset/ETHPy150Open denizalti/concoord/concoord/blockingclientproxy.py/ClientProxy.__init__