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.
|
#include <linger_option.h>
Specifies whether a xtd::net::sockets::socket will remain connected after a call to the xtd::net::sockets::socket::close or xtd::net::sockets::tcp_client::close methods and the length of time it will remain connected, if data remains to be sent.
Inherits xtd::object.
Public Member Functions | |
linger_option ()=default | |
Initializes a new instance of the xtd::net::sockets::linger_option class. | |
linger_option (bool enabled, uint32_t linger_time) | |
Initializes a new version of the xtd::net::sockets::linger_option class for the specified IP multicast group. | |
bool | enabled () const noexcept |
Gets a value that indicates whether to linger after the xtd::net::sockets::socket is closed. | |
linger_option & | enabled (bool value) noexcept |
Sets a value that indicates whether to linger after the xtd::net::sockets::socket is closed. | |
uint32_t | linger_time () const noexcept |
Gets the amount of time to remain connected after calling the xtd::net::sockets::socket::close method if data remains to be sent. | |
linger_option & | linger_time (uint32_t value) noexcept |
Sets the amount of time to remain connected after calling the xtd::net::sockets::socket::close method if data remains to be sent. | |
Public Member Functions inherited from xtd::object | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual bool | equals (const object &obj) const noexcept |
Determines whether the specified object is equal to the current object. | |
virtual size_t | get_hash_code () const noexcept |
Serves as a hash function for a particular type. | |
template<typename object_t > | |
std::unique_ptr< object_t > | memberwise_clone () const |
Gets the type of the current instance. | |
virtual xtd::ustring | to_string () const noexcept |
Returns a std::string that represents the current object. | |
Additional Inherited Members | |
Static Public Member Functions inherited from xtd::object | |
static bool | equals (const object &object_a, const object &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
|
default |
Initializes a new instance of the xtd::net::sockets::linger_option class.
xtd::net::sockets::linger_option::linger_option | ( | bool | enabled, |
uint32_t | linger_time | ||
) |
Initializes a new version of the xtd::net::sockets::linger_option class for the specified IP multicast group.
enabled | true to remain connected after the Socket.Close method is called; otherwise, false. |
linger_time | The number of seconds to remain connected after the Socket.Close method is called. |
enable | seconds | Behavior |
---|---|---|
false (disabled), the default value | The time-out is not applicable, (default). | Attempts to send pending data for a connection-oriented socket (TCP, for example) until the default IP protocol time-out expires. |
true (enabled) | A nonzero time-out | Attempts to send pending data until the specified time-out expires, and if the attempt fails, then Winsock resets the connection. |
true (enabled) | A zero timeout. | Discards any pending data. For connection-oriented socket (TCP, for example), Winsock resets the connection. |
|
noexcept |
Gets a value that indicates whether to linger after the xtd::net::sockets::socket is closed.
enable | seconds | Behavior |
---|---|---|
false (disabled), the default value | The time-out is not applicable, (default). | Attempts to send pending data for a connection-oriented socket (TCP, for example) until the default IP protocol time-out expires. |
true (enabled) | A nonzero time-out | Attempts to send pending data until the specified time-out expires, and if the attempt fails, then Winsock resets the connection. |
true (enabled) | A zero timeout. | Discards any pending data. For connection-oriented socket (TCP, for example), Winsock resets the connection. |
|
noexcept |
Sets a value that indicates whether to linger after the xtd::net::sockets::socket is closed.
value | true if the xtd::net::sockets::socket should linger after xtd::net::sockets::socket::close is called; otherwise, false. |
enable | seconds | Behavior |
---|---|---|
false (disabled), the default value | The time-out is not applicable, (default). | Attempts to send pending data for a connection-oriented socket (TCP, for example) until the default IP protocol time-out expires. |
true (enabled) | A nonzero time-out | Attempts to send pending data until the specified time-out expires, and if the attempt fails, then Winsock resets the connection. |
true (enabled) | A zero timeout. | Discards any pending data. For connection-oriented socket (TCP, for example), Winsock resets the connection. |
|
noexcept |
Gets the amount of time to remain connected after calling the xtd::net::sockets::socket::close method if data remains to be sent.
enable | seconds | Behavior |
---|---|---|
false (disabled), the default value | The time-out is not applicable, (default). | Attempts to send pending data for a connection-oriented socket (TCP, for example) until the default IP protocol time-out expires. |
true (enabled) | A nonzero time-out | Attempts to send pending data until the specified time-out expires, and if the attempt fails, then Winsock resets the connection. |
true (enabled) | A zero timeout. | Discards any pending data. For connection-oriented socket (TCP, for example), Winsock resets the connection. |
|
noexcept |
Sets the amount of time to remain connected after calling the xtd::net::sockets::socket::close method if data remains to be sent.
value | The amount of time, in seconds, to remain connected after calling xtd::net::sockets::socket::close. |
enable | seconds | Behavior |
---|---|---|
false (disabled), the default value | The time-out is not applicable, (default). | Attempts to send pending data for a connection-oriented socket (TCP, for example) until the default IP protocol time-out expires. |
true (enabled) | A nonzero time-out | Attempts to send pending data until the specified time-out expires, and if the attempt fails, then Winsock resets the connection. |
true (enabled) | A zero timeout. | Discards any pending data. For connection-oriented socket (TCP, for example), Winsock resets the connection. |