def check_websocket(self):
        msgs = 0
        events = self.epoll.poll(0)
        while events and msgs < MAX_MSGS_PER_READ:
            for fileno, event in events:
                if not (event & select.EPOLLIN):
                    self.send(self.myAddress, ActorExitRequest())
                op_code, frame = self.ws.recv_data_frame(True)
                if op_code == ABNF.OPCODE_CLOSE:
                    self.send(self.myAddress, ActorExitRequest())
                elif op_code in (ABNF.OPCODE_PING, ABNF.OPCODE_PONG, ABNF.OPCODE_CONT):
                    pass # ignore
                else:
                    msgs += 1
                    self.send(self.config.upstream, Websocket_Output(frame.data))
            events = self.epoll.poll(0)
        if msgs >= MAX_MSGS_PER_READ:
            log.critical("WebsocketClientActor not keeping up with incoming websocket data")
dataset/ETHPy150Open godaddy/Thespian/contrib/websocket.py/WebsocketClientActor.check_websocket/original