Provides the underlying stream of data for network access.
Constructors | |
network_stream (const xtd::net::sockets::socket &socket) | |
Creates a new instance of the network_stream class for the specified xtd::net::sockets::socket. More... | |
network_stream (const xtd::net::sockets::socket &socket, bool owns_socket) | |
Initializes a new instance of the xtd::net::sockets::network_stream class for the specified xtd::net::sockets::socket with the specified xtd::net::sockets::socket ownership. More... | |
Properties | |
virtual bool | data_available () const |
Gets a value that indicates whether data is available on the xtd::net::sockets::network_stream to be read. More... | |
xtd::net::sockets::socket | socket () const |
Gets the underlying xtd::net::sockets::socket. More... | |
|
explicit |
Creates a new instance of the network_stream class for the specified xtd::net::sockets::socket.
socket | The xtd::net::sockets::socket that the xtd::net::sockets::network_stream will use to send and receive data. |
xtd::net::sockets::network_stream::network_stream | ( | const xtd::net::sockets::socket & | socket, |
bool | owns_socket | ||
) |
Initializes a new instance of the xtd::net::sockets::network_stream class for the specified xtd::net::sockets::socket with the specified xtd::net::sockets::socket ownership.
socket | The xtd::net::sockets::socket that the xtd::net::sockets::network_stream will use to send and receive data. |
owns_socket | Set to true to indicate that the xtd::net::sockets::network_stream will take ownership of the xtd::net::sockets::socket; otherwise, false. |
|
virtual |
Gets a value that indicates whether data is available on the xtd::net::sockets::network_stream to be read.
xtd::net::sockets::socket_exception | An error occurred when attempting to access the socket. |
xtd::object_closed_exception | The xtd::net::sockets::socket has been closed. |
xtd::net::sockets::socket xtd::net::sockets::network_stream::socket | ( | ) | const |
Gets the underlying xtd::net::sockets::socket.