pub fn tcp_header(&self) -> TcpHeader {
        let mut header = TcpHeader::new(self.local.port, self.remote.port);
        header.window_size = self.receiver.hdr_window_size();

        // Check if we have acknowledged all bytes that we have received. If not, piggy back an ACK
        // on this message.
        if self.state.get() != State::CloseWait2 {
            if let Some(ack_seq_no) = self.receiver.current_ack() {
                header.ack_num = ack_seq_no;
                header.ack = true;
            }
        }
        header
    }
/// Fetch a TCP header filling out various values based on our current state.
Fetch a TCP header filling out various values based on our current state.
Fetch a TCP header filling out various values based on our current state .
pub fn tcp_header(&self) -> TcpHeader {
        let mut header = TcpHeader::new(self.local.port, self.remote.port);
        header.window_size = self.receiver.hdr_window_size();
        // Check if we have acknowledged all bytes that we have received. If not, piggy back an ACK
        // on this message.
        if self.state.get() != State::CloseWait2 {
            if let Some(ack_seq_no) = self.receiver.current_ack() {
                header.ack_num = ack_seq_no;
                header.ack = true;
            }
        }
        header
    }
pub fn tcp_header ( & self ) -> TcpHeader { let mut header = TcpHeader :: new ( self . local . port , self . remote . port ) ; header . window_size = self . receiver . hdr_window_size ( ) ; // Check if we have acknowledged all bytes that we have received. If not, piggy back an ACK // on this message. if self . state . get ( ) != State :: CloseWait2 { if let Some ( ack_seq_no ) = self . receiver . current_ack ( ) { header . ack_num = ack_seq_no ; header . ack = true ; } } header }
Fetch a TCP header filling out various values based on our current state.
Fetch a TCP header filling out various values based on our current state .
&self
&self