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

◆ data_available()

virtual bool xtd::net::sockets::network_stream::data_available ( ) const
virtual

Gets a value that indicates whether data is available on the xtd::net::sockets::network_stream to be read.

Returns
true if data is available on the stream to be read; otherwise, false.
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
Use the xtd::net::sockets::network_stream::data_available property to determine if data is ready to be read. If xtd::net::sockets::network_stream::data_available is true, a call to std::iostream::read returns immediately. If the remote host shuts down or closes the connection, xtd::net::sockets::network_stream::data_available may throw a xtd::net::sockets::socket_exception.