pub fn acknowledge(&mut self, ack: u16, config: &Config) -> bool {
        config.vlog(&format!(
            "Acknowledge {} for connection {} with position {} and window size {}",
            ack,
            self.static_properties.id,
            self.window_position,
            self.static_properties.window_size
        ));
        // check if it is valid packet for current window
        if !self.is_within_window(ack, &config){
            return false;
        }
        // free cache memory for acknowledge packets
        let mut current_pos = Wrapping(self.window_position);
        let end_pos = Wrapping(ack) + Wrapping::<u16>(1);
        while current_pos != end_pos {
            self.loaded_parts.remove(&current_pos.0).expect("Can't remove entry for acknowledge");
            current_pos += Wrapping::<u16>(1);
        }
        // does the window moved?
        let moved = current_pos.0 != self.window_position;
        // move window if necessary.
        self.window_position = current_pos.0;
        // return value
        return moved;
    }
/// Register acknowledge packet from the receiver with `ack` number.
/// Return `true` if the window moved, false otherwise.
Register acknowledge packet from the receiver with `ack` number.
Return `true` if the window moved, false otherwise.
Register acknowledge packet from the receiver with ` ack ` number . Return ` true ` if the window moved false otherwise .
pub fn acknowledge(&mut self, ack: u16, config: &Config) -> bool {
        config.vlog(&format!(
            "Acknowledge {} for connection {} with position {} and window size {}",
            ack,
            self.static_properties.id,
            self.window_position,
            self.static_properties.window_size
        ));
        // check if it is valid packet for current window
        if !self.is_within_window(ack, &config){
            return false;
        }
        // free cache memory for acknowledge packets
        let mut current_pos = Wrapping(self.window_position);
        let end_pos = Wrapping(ack) + Wrapping::<u16>(1);
        while current_pos != end_pos {
            self.loaded_parts.remove(&current_pos.0).expect("Can't remove entry for acknowledge");
            current_pos += Wrapping::<u16>(1);
        }
        // does the window moved?
        let moved = current_pos.0 != self.window_position;
        // move window if necessary.
        self.window_position = current_pos.0;
        // return value
        return moved;
    }
pub fn acknowledge ( & mut self , ack : u16 , config : & Config ) -> bool { config . vlog ( & format ! ( " " ack self static_properties id self window_position self static_properties window_size ) ) ; // check if it is valid packet for current window if ! self . is_within_window ( ack , & config ) { return false ; } // free cache memory for acknowledge packets let mut current_pos = Wrapping ( self . window_position ) ; let end_pos = Wrapping ( ack ) + Wrapping :: < u16 > ( 1 ) ; while current_pos != end_pos { self . loaded_parts . remove ( & current_pos . 0 ) . expect ( " " ) ; current_pos += Wrapping :: < u16 > ( 1 ) ; } // does the window moved? let moved = current_pos . 0 != self . window_position ; // move window if necessary. self . window_position = current_pos . 0 ; // return value return moved ; }
Register acknowledge packet from the receiver with `ack` number.
Register acknowledge packet from the receiver with ` ack ` number .
&mut self
ack
u16
config
&Config
&mut self
ack
u16
config
&Config