LIBWIRE
Next-generation C++17 networking library.
|
Inline namespace with options applicable for TCP sockets. More...
Classes | |
struct | keep_alive_t |
Dummy type for keep_alive option. More... | |
struct | linger_t |
Dummy type for linger option. More... | |
struct | no_delay_t |
Dummy type for no_delay option. More... | |
struct | timeout_t |
Dummy type for timeout option. More... | |
Variables | |
constexpr keep_alive_t | keep_alive {} |
Enable keep-alive probes on TCP socket. More... | |
constexpr linger_t | linger {} |
Enable linger on socket.close on TCP socket. More... | |
constexpr no_delay_t | no_delay {} |
Disable the Nagle algorithm on TCP socket. More... | |
constexpr timeout_t | timeout {} |
Set transmission timeout for TCP socket. More... | |
Inline namespace with options applicable for TCP sockets.
constexpr keep_alive_t libwire::tcp::options::keep_alive {} |
Enable keep-alive probes on TCP socket.
After reaching some implementation-defined time of inactivity TCP implementation will start to send keep-alive probes to make sure other side is still up and can accept packets.
Definition at line 118 of file options.hpp.
constexpr linger_t libwire::tcp::options::linger {} |
Enable linger on socket.close on TCP socket.
When enabled, a socket.close or socket.shutdown will not return until all queued messages for the socket have been successfully sent or the linger timeout has been reached. Otherwise, the call returns immediately and the closing is done in the background.
Definition at line 145 of file options.hpp.
constexpr no_delay_t libwire::tcp::options::no_delay {} |
Disable the Nagle algorithm on TCP socket.
This means that segments are always sent as soon as possible, even if there is only a small amount of data. When not set, data is buffered until there is a sufficient amount to send out, thereby avoiding the frequent sending of small packets, which results in poor utilization of the network.
Definition at line 66 of file options.hpp.
constexpr timeout_t libwire::tcp::options::timeout {} |
Set transmission timeout for TCP socket.
This option takes an unsigned int as an argument. When the value is greater than 0, it specifies the maximum amount of time in milliseconds that transmitted data may remain unacknowledged before TCP will forcibly close the corresponding connection and return error::timeout to the application. If the option value is specified as 0, TCP will to use the system default.
Usually you don't have to worry about timeouts, most systems by default have giant transmission timeout (up to 2 hours on UNIXes).
Definition at line 101 of file options.hpp.