#include <xtd/xtd>
using namespace std;
using namespace std::literals;
int main() {
auto terminate_app = false;
thread server([&] {
server_socket.listen();
stream_reader reader(stream);
while (!terminate_app)
});
thread client([&] {
stream_writer writer(stream);
auto counter = 1;
while (!terminate_app) {
this_thread::sleep_for(50ms);
}
});
terminate_app = true;
server.join();
client.join();
}
static console_key_info read_key()
Obtains the next character or function key pressed by the user. The pressed key is displayed in the c...
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
static ip_address any
Provides an IP address that indicates that the server must listen for client activity on all network ...
Definition: ip_address.h:34
static ip_address loopback
Provides the IP loopback address. This field is constant.
Definition: ip_address.h:50
network_stream(const xtd::net::sockets::socket &socket)
Creates a new instance of the network_stream class for the specified xtd::net::sockets::socket.
xtd::net::sockets::socket socket() const
Gets the underlying xtd::net::sockets::socket.
@ inter_network
Address for IP version 4.
@ tcp
Transmission Control Protocol.
@ stream
Supports reliable, two-way, connection-based byte streams without the duplication of data and without...
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition: directory_not_found_exception.h:10
The xtd::net::sockets namespace provides a managed implementation of the Berkeley Sockets interface f...
Definition: address_family.h:17
The xtd::net namespace provides a simple programming interface for many of the protocols used on netw...
Definition: cookie_exception.h:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17