(self)
Recieve data with operation code.

        return  value: tuple of operation code and string(byte array) value.
Recieve data with operation code.
Recieve data with operation code .
def recv_data(self):
        """
        Recieve data with operation code.

        return  value: tuple of operation code and string(byte array) value.
        """
        while True:
            frame = self.recv_frame()
            if not frame:
                # handle error:
                # 'NoneType' object has no attribute 'opcode'
                raise WebSocketException("Not a valid frame %s" % frame)
            elif frame.opcode in (ABNF.OPCODE_TEXT, ABNF.OPCODE_BINARY):
                return (frame.opcode, frame.data)
            elif frame.opcode == ABNF.OPCODE_CLOSE:
                self.send_close()
                return (frame.opcode, None)
            elif frame.opcode == ABNF.OPCODE_PING:
                self.pong(frame.data)
def recv_data ( self ) : while True : frame = self . recv_frame ( ) if not frame : # handle error: # 'NoneType' object has no attribute 'opcode' raise WebSocketException ( "Not a valid frame %s" % frame ) elif frame . opcode in ( ABNF . OPCODE_TEXT , ABNF . OPCODE_BINARY ) : return ( frame . opcode , frame . data ) elif frame . opcode == ABNF . OPCODE_CLOSE : self . send_close ( ) return ( frame . opcode , None ) elif frame . opcode == ABNF . OPCODE_PING : self . pong ( frame . data )