//! \name "Input" interface for the writer //!@{ ByteStream &stream_in(){ return _stream; } const ByteStream &stream_in()const{ return _stream; } //!@}
//! \name Methods that can cause the TCPSender to send a segment //!@{
//! \brief A new acknowledgment was received voidack_received(const WrappingInt32 ackno, constuint16_t window_size);
//! \brief Generate an empty-payload segment (useful for creating empty ACK segments) voidsend_empty_segment();
//! \brief create and send segments to fill as much of the window as possible voidfill_window();
//! \brief Notifies the TCPSender of the passage of time voidtick(constsize_t ms_since_last_tick); //!@}
//! \name Accessors //!@{
//! \brief How many sequence numbers are occupied by segments sent but not yet acknowledged? //! \note count is in "sequence space," i.e. SYN and FIN each count for one byte //! (see TCPSegment::length_in_sequence_space()) size_tbytes_in_flight()const;
//! \brief Number of consecutive retransmissions that have occurred in a row unsignedintconsecutive_retransmissions()const;
//! \brief TCPSegments that the TCPSender has enqueued for transmission. //! \note These must be dequeued and sent by the TCPConnection, //! which will need to fill in the fields that are set by the TCPReceiver //! (ackno and window size) before sending. std::queue<TCPSegment> &segments_out(){ return _segments_out; } //!@}
//! \name What is the next sequence number? (used for testing) //!@{
//! \brief absolute seqno for the next byte to be sent uint64_tnext_seqno_absolute()const{ return _next_seqno; }
//! \brief relative seqno for the next byte to be sent WrappingInt32 next_seqno()const{ returnwrap(_next_seqno, _isn); } //!@} };