|
Sponge
CS144's user-space TCP library
|
Go to the documentation of this file.
10 template <
typename... Targs>
42 cerr <<
"Warning: Unclean shutdown of TCPConnection\n";
void connect()
Initiate a connection by sending a SYN segment.
size_t unassembled_bytes() const
number of bytes not yet reassembled
size_t time_since_last_segment_received() const
Number of milliseconds since the last segment was received.
void DUMMY_CODE(Targs &&...)
void end_input_stream()
Shut down the outbound byte stream (still allows reading incoming data)
size_t remaining_outbound_capacity() const
size_t bytes_in_flight() const
number of bytes sent and not yet acknowledged, counting SYN/FIN each as one byte
bool active() const
Is the connection still alive in any way?
void segment_received(const TCPSegment &seg)
Called when a new segment has been received from the network.
~TCPConnection()
destructor sends a RST if the connection is still open
size_t write(const std::string &data)
Write data to the outbound byte stream, and send it over TCP if possible.
void tick(const size_t ms_since_last_tick)
Called periodically when time elapses.