xtd 0.2.0
linger_option.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../ip_address.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;
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;
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
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
linger_option(bool enabled, uint32 linger_time)
Initializes a new version of the xtd::net::sockets::linger_option class for the specified IP multicas...
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
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.
xtd::uint32 linger_time() const noexcept
Gets the amount of time to remain connected after calling the xtd::net::sockets::socket::close method...
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Contains core_export_ keyword.
#define core_export_
Define shared library export.
Definition core_export.hpp:13
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
@ other
The operating system is other.
Definition platform_id.hpp:58
Contains xtd::iequatable interface.
The xtd::net::sockets namespace provides a managed implementation of the Berkeley Sockets interface f...
Definition address_family.hpp:16
The xtd::net namespace provides a simple programming interface for many of the protocols used on netw...
Definition cookie_exception.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::net::ip_address class.
Contains xtd::object class.
Contains xtd::string alias.
Contains xtd fundamental types.