6#include "../ip_end_point.hpp"
7#include "../../threading/manual_reset_event.hpp"
8#include "../../iequatable.hpp"
9#include "../../object.hpp"
10#include "../../string.hpp"
48 explicit async_result_socket(
const xtd::any_object& async_state) : async_state_(async_state) {}
49 xtd::any_object async_state()
const noexcept override {
return async_state_;}
51 bool completed_synchronously()
const noexcept override {
return false;}
52 bool is_completed()
const noexcept override {
return is_completed_;};
55 bool is_completed_ =
false;
58 std::exception_ptr exception_;
61 class async_result_receive :
public async_result_socket {
63 explicit async_result_receive(
const xtd::any_object& async_state) : async_result_socket(async_state) {}
68 class async_result_send :
public async_result_socket {
70 explicit async_result_send(
const xtd::any_object& async_state) : async_result_socket(async_state) {}
71 size_t number_of_bytes_sent_ = 0;
163 bool dont_fragment() const;
179 bool enable_broadcast() const;
196 bool exclusive_address_use() const;
213 bool multicast_loopback() const;
251 void allow_nat_traversal(
bool allowed);
377 bool equals(const
object& obj) const noexcept override;
381 bool equals(const
udp_client& other) const noexcept override;
489 bool active() const noexcept;
Represent a polymorphic wrapper capable of holding any type.
Definition any_object.hpp:29
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
Represents text as a sequence of character units.
Definition basic_string.hpp:71
Represents the status of an asynchronous operation.
Definition iasync_result.hpp:25
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Identifies a network address. This is an abstract class.
Definition end_point.hpp:27
Provides an Internet Protocol (IP) address.
Definition ip_address.hpp:42
Represents a network endpoint as an IP address and a port number.
Definition ip_end_point.hpp:28
Implements the Berkeley sockets interface.
Definition socket.hpp:77
Provides User Datagram Protocol (UDP) network services.
Definition udp_client.hpp:45
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::string &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.hpp:43
The xtd::shared_ptr_object is a shared pointer as std::shared_ptr.
Definition shared_ptr_object.hpp:30
Represents a thread synchronization event that, when signaled, must be reset manually....
Definition manual_reset_event.hpp:35
Encapsulates operating system specific objects that wait for exclusive access to shared resources.
Definition wait_handle.hpp:52
xtd::delegate< void(async_result ar)> async_callback
References a method to be called when a corresponding asynchronous operation completes.
Definition delegate.hpp:39
#define core_export_
Define shared library export.
Definition core_export.hpp:13
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.hpp:23
socket_error
Defines error codes for the xtd::net::sockets::socket class.
Definition socket_error.hpp:30
address_family
Specifies the addressing scheme that an instance of the xtd::net::sockets::socket class can use.
Definition address_family.hpp:30
@ success
Operation successful.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::net::sockets::socket class.