xtd 0.2.0
Loading...
Searching...
No Matches

◆ blocking() [1/2]

bool xtd::net::sockets::socket::blocking ( ) const

Gets a value that indicates whether the xtd::net::sockets::socket is in blocking mode.

Returns
true if the xtd::net::sockets::socket will block; otherwise, false. The default is true.
Exceptions
xtd::net::sockets::socket_exceptionAn error occurred when attempting to access the socket.
xtd::object_closed_exceptionThe xtd::net::sockets::socket has been closed.
Remarks
The xtd::net::sockets::socket::blocking property indicates whether a xtd::net::sockets::socket is in blocking mode.
If you are in blocking mode, and you make a method call which does not complete immediately, your application will block execution until the requested operation completes. If you want execution to continue even though the requested operation is not complete, change the xtd::net::sockets::socket::blocking property to false. The xtd::net::sockets::socket::blocking property has no effect on asynchronous methods. If you are sending and receiving data asynchronously and want to block execution, use the xtd::threading::manual_reset_event class.
Note
If you receive a xtd::net::sockets::socket_exception, use the xtd::net::sockets::socket_exception::error_code property to obtain the specific error code. After you have obtained this code, refer to the Windows Sockets version 2 API error code documentation for a detailed description of the error.