xtd - Reference Guide  0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
linger_option.h
Go to the documentation of this file.
1
4#pragma once
5
6#include "../../core_export.h"
7#include "../../object.h"
8#include "../../types.h"
9#include "../../ustring.h"
10#include "../ip_address.h"
11
13namespace xtd {
15 namespace net {
17 namespace sockets {
27 public:
29 linger_option() = default;
42 linger_option(bool enabled, uint32_t linger_time);
43
47 linger_option& operator=(const linger_option&) = default;
48 friend std::ostream& operator <<(std::ostream& os, const linger_option& mo) noexcept {return os << mo.to_string();}
50
62 bool enabled() const noexcept;
74 linger_option& enabled(bool value) noexcept;
75
88 uint32_t linger_time() const noexcept;
101 linger_option& linger_time(uint32_t value) noexcept;
102
103 private:
104 bool enabled_ = false;
105 uint32_t linger_time_ = 0;
106 };
107 }
108 }
109}
Specifies whether a xtd::net::sockets::socket will remain connected after a call to the xtd::net::soc...
Definition linger_option.h:26
linger_option(bool enabled, uint32_t linger_time)
Initializes a new version of the xtd::net::sockets::linger_option class for the specified IP multicas...
linger_option()=default
Initializes a new instance of the xtd::net::sockets::linger_option class.
bool enabled() const noexcept
Gets a value that indicates whether to linger after the xtd::net::sockets::socket is closed.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:26
virtual xtd::ustring to_string() const noexcept
Returns a std::string that represents the current object.
#define core_export_
Define shared library export.
Definition core_export.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17