|
Sponge
CS144's user-space TCP library
|
Go to the documentation of this file. 1 #ifndef SPONGE_LIBSPONGE_FD_ADAPTER_HH
2 #define SPONGE_LIBSPONGE_FD_ADAPTER_HH
55 std::optional<TCPSegment>
read();
70 #endif // SPONGE_LIBSPONGE_FD_ADAPTER_HH
bool _listen
Is the connected TCP FSM in listen state?
FdAdapterConfig & config_mut()
Get the current configuration (mutable)
TCPOverUDPSocketAdapter(UDPSocket &&sock)
Construct from a UDPSocket sliced into a FileDescriptor.
bool listening() const
Get the listening flag.
void write(TCPSegment &seg)
Writes a TCP segment into a UDP payload.
std::optional< TCPSegment > read()
Attempts to read and return a TCP segment related to the current connection from a UDP payload.
Config for classes derived from FdAdapter.
An adapter class that adds random dropping behavior to an FD adapter.
Basic functionality for file descriptor adaptors.
A wrapper around UDP sockets.
void tick(const size_t)
Called periodically when time elapses.
const FdAdapterConfig & config() const
Get the current configuration.
void set_listening(const bool l)
Set the listening flag.
FdAdapterConfig _cfg
Configuration values.
A FD adaptor that reads and writes TCP segments in UDP payloads.
FdAdapterConfig & config_mutable()