6#include "../../object.h"
7#include "../../ustring.h"
8#include "../ip_end_point.h"
68 friend std::ostream& operator <<(std::ostream& os,
const tcp_client& tc)
noexcept {
return os << tc.
to_string();}
69 bool operator==(
const tcp_client&
s)
const {
return data_ ==
s.data_;};
70 bool operator!=(
const tcp_client&
s)
const {
return !operator==(
s);};
334 std::shared_ptr<data> data_;
Represents the status of an asynchronous operation.
Definition iasync_result.h:21
Identifies a network address. This is an abstract class.
Definition end_point.h:24
Provides an Internet Protocol (IP) address.
Definition ip_address.h:30
Represents a network endpoint as an IP address and a port number.
Definition ip_end_point.h:20
Specifies whether a xtd::net::sockets::socket will remain connected after a call to the xtd::net::soc...
Definition linger_option.h:26
Provides the underlying stream of data for network access.
Definition network_stream.h:29
Implements the Berkeley sockets interface.
Definition socket.h:63
Provides client connections for TCP network services.
Definition tcp_client.h:39
size_t available() const
Gets the amount of data that has been received from the network and is available to be read.
xtd::net::sockets::network_stream get_stream() const
Returns the xtd::net::sockets::network_stream used to send and receive data.
bool exclusive_address_use() const
Gets a bool value that specifies whether the xtd::net::sockets::tcp_client allows only one client to ...
std::shared_ptr< xtd::iasync_result > begin_connect(const xtd::net::ip_address &address, uint16_t port, xtd::async_callback callback, const std::any &state)
Begins an asynchronous request for a remote host connection. The remote host is specified by an xtd::...
void close()
Disposes this xtd::net::sockets::tcp_client instance and requests that the underlying TCP connection ...
xtd::net::sockets::socket client() const noexcept
Gets the underlying network xtd::net::sockets::socket.
bool connected() const noexcept
Gets a value indicating whether the underlying xtd::net::sockets::socket for a xtd::net::sockets::tcp...
xtd::net::sockets::linger_option linger_state() const
Gets a value that specifies whether the xtd::net::sockets::socket will delay closing a socket in an a...
int32_t send_timeout() const
Gets the amount of time a xtd::net::sockets::tcp_client will wait for a send operation to complete su...
tcp_client()
Initializes a new instance of the xtd::net::sockets::tcp_client class.
size_t send_buffer_size() const
Gets the size of the send buffer.
tcp_client(const xtd::net::ip_end_point &end_point)
Initializes a new instance of the xtd::net::sockets::tcp_client class and binds it to the specified l...
tcp_client(xtd::net::sockets::address_family address_family)
The xtd::net::sockets::address_family of the IP protocol.
bool active() const noexcept
Gets a value that indicates whether a connection has been made.
bool no_delay() const
Gets a value that disables a delay when send or receive buffers are not full.
void end_connect(std::shared_ptr< xtd::iasync_result > async_result)
Ends a pending asynchronous connection attempt.
tcp_client(const xtd::ustring &hostname, uint16_t port)
Initializes a new instance of the xtd::net::sockets::tcp_client class and connects to the specified p...
size_t receive_buffer_size() const
Gets the size of the receive buffer.
int32_t receive_timeout() const
Gets the amount of time a xtd::net::sockets::tcp_client will wait to receive data once a read operati...
Listens for connections from TCP network clients.
Definition tcp_listener.h:30
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:26
virtual xtd::ustring to_string() const noexcept
Returns a std::string that represents the current object.
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:48
address_family
Specifies the addressing scheme that an instance of the xtd::net::sockets::socket class can use.
Definition address_family.h:24
delegate< void(std::shared_ptr< xtd::iasync_result > ar)> async_callback
References a method to be called when a corresponding asynchronous operation completes.
Definition async_callback.h:18
@ any
Indicates that all styles except allow_binary_specifier, allow_octal_specifier and allow_hex_specifie...
@ connect
A socket connect operation.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17
Contains xtd::net::sockets::network_stream class.
Contains xtd::net::sockets::socket class.