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.
Public Constructors | |
| linger_option ()=default | |
| Initializes a new instance of the xtd::net::sockets::linger_option class. | |
| linger_option (bool enabled, xtd::uint32 linger_time) | |
| Initializes a new version of the xtd::net::sockets::linger_option class for the specified IP multicast group. | |
Public Properties | |
| auto | enabled () const noexcept -> bool |
| Gets a value that indicates whether to linger after the xtd::net::sockets::socket is closed. | |
| auto | enabled (bool value) noexcept -> linger_option & |
| Sets a value that indicates whether to linger after the xtd::net::sockets::socket is closed. | |
| auto | linger_time () const noexcept -> xtd::uint32 |
| Gets the amount of time to remain connected after calling the xtd::net::sockets::socket::close method if data remains to be sent. | |
| auto | linger_time (xtd::uint32 value) noexcept -> linger_option & |
| Sets the amount of time to remain connected after calling the xtd::net::sockets::socket::close method if data remains to be sent. | |
Public Methods | |
| auto | equals (const object &obj) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | equals (const linger_option &other) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | get_hash_code () const noexcept -> xtd::usize override |
| Serves as a hash function for a particular type. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual auto | get_type () const noexcept -> type_object |
| Gets the type of the current instance. | |
| template<typename object_t> | |
| auto | memberwise_clone () const -> xtd::unique_ptr_object< object_t > |
| Creates a shallow copy of the current object. | |
| virtual auto | to_string () const -> xtd::string |
| Returns a xtd::string that represents the current object. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are considered equal. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| 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, |
| xtd::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. |
|
nodiscardnoexcept |
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. |
|
nodiscardnoexcept |
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. |
|
nodiscardoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
Reimplemented from xtd::object.
|
nodiscardoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| other | The object to compare with the current object. |
Implements xtd::iequatable< xtd::net::sockets::linger_option >.
|
nodiscardoverridevirtualnoexcept |
Serves as a hash function for a particular type.
Reimplemented from xtd::object.