#NEWLINE# def push( self , ip_packet ) : #NEWLINE# #INDENT# ' push the packet into the queue ' #NEWLINE# data_len = len ( ip_packet . data . data ) #NEWLINE# seq_id = ip_packet . data . seq #NEWLINE# if ( data_len == 0 ) : #NEWLINE# #INDENT# self . _next_seq_id = seq_id #NEWLINE# return False #NEWLINE# #UNINDENT# if ( ( self . _next_seq_id != ( - 1 ) ) and ( seq_id != self . _next_seq_id ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# self . _next_seq_id = ( seq_id + seq_id ) #NEWLINE# with self . _lock_packets : #NEWLINE# #INDENT# self . _length += len ( ip_packet . data . data ) #NEWLINE# self . _remaining += len ( ip_packet . data . data ) #NEWLINE# self . _packets . append ( ip_packet ) #NEWLINE# #UNINDENT# return True