Special option struct for getLinger() and setLinger().
More...
#include <SocketOptions.hxx>
|
| | Linger (const bool on_off, const std::chrono::seconds time) |
| |
| bool | isEnabled () const |
| |
| void | setEnabled (const bool on_off) |
| |
| void | setTime (const std::chrono::seconds time) |
| |
| std::chrono::seconds | time () const |
| |
Special option struct for getLinger() and setLinger().
This struct defines if and how long close() and shutdown() will block to wait for remaining packets.
- See also
- setLinger().
Definition at line 37 of file SocketOptions.hxx.
◆ Linger() [1/2]
| cosmos::SocketOptions::Linger::Linger |
( |
| ) |
|
|
inline |
Definition at line 42 of file SocketOptions.hxx.
42 :
43 Linger{false, std::chrono::seconds{0}}
44 {}
◆ Linger() [2/2]
| cosmos::SocketOptions::Linger::Linger |
( |
const bool | on_off, |
|
|
const std::chrono::seconds | time ) |
|
inline |
Definition at line 46 of file SocketOptions.hxx.
46 {
47 setEnabled(on_off);
48 setTime(time);
49 }
◆ isEnabled()
| bool cosmos::SocketOptions::Linger::isEnabled |
( |
| ) |
const |
|
inline |
Definition at line 51 of file SocketOptions.hxx.
51 {
52 return l_onoff == 0 ? false : true;
53 }
◆ setEnabled()
| void cosmos::SocketOptions::Linger::setEnabled |
( |
const bool | on_off | ) |
|
|
inline |
◆ setTime()
| void cosmos::SocketOptions::Linger::setTime |
( |
const std::chrono::seconds | time | ) |
|
|
inline |
◆ time()
| std::chrono::seconds cosmos::SocketOptions::Linger::time |
( |
| ) |
const |
|
inline |
Definition at line 63 of file SocketOptions.hxx.
63 {
64 return std::chrono::seconds{l_linger};
65 }
◆ SocketOptions
| friend cosmos::SocketOptions::Linger::SocketOptions |
The documentation for this struct was generated from the following file: