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.
Constructors | |
| linger_option ()=default | |
| Initializes a new instance of the xtd::net::sockets::linger_option class. More... | |
| linger_option (bool enabled, uint32 linger_time) | |
| Initializes a new version of the xtd::net::sockets::linger_option class for the specified IP multicast group. More... | |
Properties | |
| bool | enabled () const noexcept |
| Gets a value that indicates whether to linger after the xtd::net::sockets::socket is closed. More... | |
| linger_option & | enabled (bool value) noexcept |
| Sets a value that indicates whether to linger after the xtd::net::sockets::socket is closed. More... | |
| uint32 | 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. More... | |
| linger_option & | linger_time (uint32 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. More... | |
Additional Inherited Members | |
Public Member Functions inherited from xtd::object | |
| object ()=default | |
| Create a new instance of the ultimate base class object. More... | |
| bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object. More... | |
| virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type. More... | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. More... | |
| template<typename object_t > | |
| std::unique_ptr< object_t > | memberwise_clone () const noexcept |
| Creates a shallow copy of the current object. More... | |
| virtual xtd::ustring | to_string () const noexcept |
| Returns a sxd::ustring that represents the current object. More... | |
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. More... | |
| static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are the same instance. More... | |
|
default |
Initializes a new instance of the xtd::net::sockets::linger_option class.
| xtd::net::sockets::linger_option::linger_option | ( | bool | enabled, |
| uint32 | 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. |