6#include "../ip_end_point.h"
7#include "../../threading/manual_reset_event.h"
8#include "../../iequatable.h"
9#include "../../object.h"
10#include "../../ustring.h"
46 explicit async_result_socket(std::any async_state) : async_state_(async_state) {}
47 std::any async_state()
const noexcept override {
return async_state_;}
49 bool completed_synchronously()
const noexcept override {
return false;}
50 bool is_completed()
const noexcept override {
return is_completed_;};
52 std::any async_state_;
53 bool is_completed_ =
false;
56 std::exception_ptr exception_;
59 class async_result_receive :
public async_result_socket {
61 explicit async_result_receive(std::any async_state) : async_result_socket(async_state) {}
62 std::vector<xtd::byte> buffer_;
66 class async_result_send :
public async_result_socket {
68 explicit async_result_send(std::any async_state) : async_result_socket(async_state) {}
69 size_t number_of_bytes_sent_ = 0;
161 bool dont_fragment() const;
177 bool enable_broadcast() const;
194 bool exclusive_address_use() const;
211 bool multicast_loopback() const;
249 void allow_nat_traversal(
bool allowed);
372 bool equals(const
udp_client& s) const noexcept override;
448 size_t send(const std::vector<
xtd::
byte>& dgram,
size_t bytes, const
xtd::
ustring& hostname,
uint16 port);
470 size_t send(const std::vector<
xtd::
byte>& dgram,
size_t bytes);
480 bool active() const noexcept;
491 std::shared_ptr<data> data_;
Represents the status of an asynchronous operation.
Definition iasync_result.h:22
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:18
Identifies a network address. This is an abstract class.
Definition end_point.h:25
Provides an Internet Protocol (IP) address.
Definition ip_address.h:35
Represents a network endpoint as an IP address and a port number.
Definition ip_end_point.h:21
Implements the Berkeley sockets interface.
Definition socket.h:71
Provides User Datagram Protocol (UDP) network services.
Definition udp_client.h:43
udp_client(uint16 port, xtd::net::sockets::address_family addressFamily)
Initializes a new instance of the xtd::net::sockets::udp_client class and binds it to the local port ...
udp_client(uint16 port)
Initializes a new instance of the xtd::net::sockets::udp_client class and binds it to the local port ...
udp_client(const xtd::net::ip_end_point &local_end_point)
Initializes a new instance of the xtd::net::sockets::udp_client class and binds it to the specified l...
udp_client(const xtd::ustring &hostname, uint16 port)
Initializes a new instance of the xtd::net::sockets::udp_client class and establishes a default remot...
xtd::net::sockets::socket client() const noexcept
Gets the underlying network xtd::net::sockets::socket.
udp_client()
Initializes a new instance of the xtd::net::sockets::udp_client class.
size_t available() const
Gets the amount of data received from the network that is available to read.
udp_client(xtd::net::sockets::address_family address_Family)
Initializes a new instance of the xtd::net::sockets::udp_client class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
Represents a thread synchronization event that, when signaled, must be reset manually....
Definition manual_reset_event.h:33
Encapsulates operating system specific objects that wait for exclusive access to shared resources.
Definition wait_handle.h:50
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define core_export_
Define shared library export.
Definition core_export.h:13
uint_least16_t uint16
Represents a 16-bit unsigned integer.
Definition types.h:230
uint_least32_t uint32
Represents a 32-bit unsigned integer.
Definition types.h:241
socket_error
Defines error codes for the xtd::net::sockets::socket class.
Definition socket_error.h:28
std::shared_ptr< xtd::iasync_result > async_result
Represents the status of an asynchronous operation.
Definition async_result.h:16
delegate< void(async_result ar)> async_callback
References a method to be called when a corresponding asynchronous operation completes.
Definition delegate.h:34
address_family
Specifies the addressing scheme that an instance of the xtd::net::sockets::socket class can use.
Definition address_family.h:28
@ success
Operation successful.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::net::sockets::socket class.