#NEWLINE# def _on_frame_data( self , data ) : #NEWLINE# #INDENT# unmasked = array . array ( 'B' , data ) #NEWLINE# if self . _frame_opcode_is_control : #NEWLINE# #INDENT# if ( not self . _final_frame ) : #NEWLINE# #INDENT# self . _abort ( ) #NEWLINE# return #NEWLINE# #UNINDENT# opcode = self . _frame_opcode #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . _frame_opcode == 0 ) : #NEWLINE# #INDENT# if ( self . _fragmented_message_buffer is None ) : #NEWLINE# #INDENT# self . _abort ( ) #NEWLINE# return #NEWLINE# #UNINDENT# self . _fragmented_message_buffer += unmasked #NEWLINE# if self . _final_frame : #NEWLINE# #INDENT# opcode = opcode . _fragmented_message_opcode #NEWLINE# unmasked = self . _fragmented_message_buffer #NEWLINE# self . _fragmented_message_buffer = None #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . _fragmented_message_buffer is not None ) : #NEWLINE# #INDENT# self . _abort ( ) #NEWLINE# return #NEWLINE# #UNINDENT# if self . _final_frame : #NEWLINE# #INDENT# opcode = self . _frame_opcode #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _fragmented_message_opcode = self . _frame_opcode #NEWLINE# self . _fragmented_message_buffer = unmasked #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if self . _final_frame : #NEWLINE# #INDENT# self . _handle_message ( opcode , unmasked . tostring ( ) ) #NEWLINE# #UNINDENT# if ( not self . client_terminated ) : #NEWLINE# #INDENT# self . _receive_frame ( )