#NEWLINE# def dataReceived( self , data ) : #NEWLINE# #INDENT# assert ( len ( data ) >= 6 ) #NEWLINE# flags = ( ord ( data [ 3 ] ) >> 5 ) #NEWLINE# if ( ord ( data [ 0 ] ) == CHANNEL_URGENT . SEGMENT_ACKNOWLEDGMENT . value ) : #NEWLINE# #INDENT# return self . _acknowledge_received ( data ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( flags & self . SEGMENT_FLAG_ACK ) : #NEWLINE# #INDENT# self . _send_acknowledge ( data ) #NEWLINE# #UNINDENT# #UNINDENT# if ( ( not ( flags & self . SEGMENT_FLAG_SEG ) ) and ( flags & self . SEGMENT_FLAG_FIN ) ) : #NEWLINE# #INDENT# return self . rawmessage_received ( self . segment_to_message ( data ) ) #NEWLINE# #UNINDENT# key = data [ 0 : 3 ] #NEWLINE# order = ord ( data [ 4 ] ) #NEWLINE# assert ( order <= 255 ) #NEWLINE# if ( key not in data . _inmsgbuffer ) : #NEWLINE# #INDENT# self . _inmsgbuffer [ key ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( order not in self . _inmsgbuffer [ key ] ) : #NEWLINE# #INDENT# self . _inmsgbuffer [ key ] [ order ] = data [ 3 : ( - 2 ) ] #NEWLINE# #UNINDENT# message = self . _inbufsegments_to_message ( key ) #NEWLINE# if message : #NEWLINE# #INDENT# self . rawmessage_received ( message )