xtd 0.2.0
linger_option.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../ip_address.hpp"
6#include "../../core_export.hpp"
7#include "../../iequatable.hpp"
8#include "../../object.hpp"
9#include "../../types.hpp"
10#include "../../string.hpp"
11
13namespace xtd {
15 namespace net {
17 namespace sockets {
35 class core_export_ linger_option : public xtd::object, public xtd::iequatable<xtd::net::sockets::linger_option> {
36 public:
38
41 linger_option() = default;
54 linger_option(bool enabled, uint32 linger_time);
56
60 linger_option& operator =(const linger_option&) = default;
62
64
78 bool enabled() const noexcept;
91 linger_option& enabled(bool value) noexcept;
92
106 xtd::uint32 linger_time() const noexcept;
120 linger_option& linger_time(xtd::uint32 value) noexcept;
122
124
129 bool equals(const object& obj) const noexcept override;
133 bool equals(const linger_option& other) const noexcept override;
134
137 xtd::size get_hash_code() const noexcept override;
139
140 private:
141 bool enabled_ = false;
142 xtd::uint32 linger_time_ = 0;
143 };
144 }
145 }
146}
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Specifies whether a xtd::net::sockets::socket will remain connected after a call to the xtd::net::soc...
Definition linger_option.hpp:35
linger_option(bool enabled, uint32 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.hpp:44
#define core_export_
Define shared library export.
Definition core_export.hpp:13
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10