def recvloop(self):
        ''' Thread target that receives messages from server sockets.
        '''
        self.dorecvloop = True
        # note: this loop continues after emulation is stopped, 
        # even with 0 servers
        while self.dorecvloop:
            rlist = []
            with self.servers_lock:
                # build a socket list for select call
                for name in self.servers:
                    (h, p, sock) = self.servers[name]
                    if sock is not None:
                        rlist.append(sock.fileno())
            r, w, x = select.select(rlist, [], [], 1.0)
            for sockfd in r:
                try:
                    (h, p, sock, name) = self.getserverbysock(sockfd)
                except KeyError:
                    # servers may have changed; loop again
                    break
                rcvlen = self.recv(sock, h)
                if rcvlen == 0:
                    if self.verbose:
                        self.session.info("connection with %s @ %s:%s" \
                                          " has closed" % (name, h, p))
                    self.servers[name] = (h, p, None)
dataset/ETHPy150Open coreemu/core/daemon/core/broker.py/CoreBroker.recvloop/original