#include <xtd/xtd>
using namespace std;
using namespace std::literals;
int main() {
auto terminate_app = false;
thread server([&] {
server_socket.listen();
while (!terminate_app)
});
thread client([&] {
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...
Implements a xtd::io::text_reader that reads characters from a byte stream.
Definition: stream_reader.h:20
Implements a xtd::io::text_writer for writing characters to a stream.
Definition: stream_writer.h:20
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
Represents a network endpoint as an IP address and a port number.
Definition: ip_end_point.h:20
Provides the underlying stream of data for network access.
Definition: network_stream.h:29
xtd::net::sockets::socket socket() const
Gets the underlying xtd::net::sockets::socket.
Implements the Berkeley sockets interface.
Definition: socket.h:63
@ 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