xtd - Reference Guide
0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
|
#include <socket_async_event_args.h>
Represents an asynchronous socket operation.
Inherits xtd::event_args.
Public Attributes | |
xtd::event< socket_async_event_args, xtd::delegate< void(const socket_async_event_args &)> > | completed |
The event used to complete an asynchronous operation. | |
Public Member Functions | |
socket_async_event_args ()=default | |
Creates an empty xtd::net::sockets::socket_async_event_args instance. | |
socket_async_event_args (bool suppress_execution_context_flow) | |
Initializes the SocketAsyncEventArgs. | |
xtd::net::sockets::socket | accept_socket () const noexcept |
Gets the socket to use or the socket created for accepting a connection with an asynchronous socket method. | |
socket_async_event_args & | accept_socket (const xtd::net::sockets::socket &value) noexcept |
Sets the socket to use or the socket created for accepting a connection with an asynchronous socket method. | |
const std::vector< byte_t > & | buffer () const noexcept |
Gets the data buffer to use with an asynchronous socket method. | |
std::vector< byte_t > & | buffer () noexcept |
Gets the data buffer to use with an asynchronous socket method. | |
void | set_buffer (const std::vector< byte_t > &buffer, size_t count, size_t offset) |
Sets the data buffer to use with an asynchronous socket method. | |
void | set_buffer (const std::vector< byte_t > &memory_buffer) |
Sets the region of memory to use as a buffer with an asynchronous socket method. | |
void | set_buffer (size_t offset, size_t count) |
Sets the data buffer to use with an asynchronous socket method. | |
Public Member Functions inherited from xtd::event_args | |
event_args ()=default | |
Initializes a new instance of the event_args class. | |
Public Member Functions inherited from xtd::object | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual bool | equals (const object &obj) const noexcept |
Determines whether the specified object is equal to the current object. | |
virtual size_t | get_hash_code () const noexcept |
Serves as a hash function for a particular type. | |
template<typename object_t > | |
std::unique_ptr< object_t > | memberwise_clone () const |
Gets the type of the current instance. | |
virtual xtd::ustring | to_string () const noexcept |
Returns a std::string that represents the current object. | |
Protected Member Functions | |
virtual void | on_complete (const socket_async_event_args &e) |
Represents a method that is called when an asynchronous operation completes. | |
Additional Inherited Members | |
Static Public Attributes inherited from xtd::event_args | |
static const event_args | empty |
Provides a value to use with events that do not have event data. | |
Static Public Member Functions inherited from xtd::object | |
static bool | equals (const object &object_a, const object &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
|
default |
Creates an empty xtd::net::sockets::socket_async_event_args instance.
xtd::net::sockets::socket_async_event_args::socket_async_event_args | ( | bool | suppress_execution_context_flow | ) |
Initializes the SocketAsyncEventArgs.
suppress_execution_context_flow | Whether to disable the capturing and flow of execution context. Execution context flow should only be disabled if it's handled by higher layers. |
|
noexcept |
Gets the socket to use or the socket created for accepting a connection with an asynchronous socket method.
|
noexcept |
Sets the socket to use or the socket created for accepting a connection with an asynchronous socket method.
value | The xtd::net::sockets::socket to use or the socket created for accepting a connection with an asynchronous socket method. |
|
noexcept |
Gets the data buffer to use with an asynchronous socket method.
|
noexcept |
Gets the data buffer to use with an asynchronous socket method.
|
protectedvirtual |
Represents a method that is called when an asynchronous operation completes.
e | The event that is signaled. |
void xtd::net::sockets::socket_async_event_args::set_buffer | ( | const std::vector< byte_t > & | buffer, |
size_t | count, | ||
size_t | offset | ||
) |
Sets the data buffer to use with an asynchronous socket method.
buffer | The data buffer to use with an asynchronous socket method. |
offset | The offset, in bytes, in the data buffer where the operation starts. |
count | The maximum amount of data, in bytes, to send or receive in the buffer. |
xtd::argument_out_of_range_exception | An argument was out of range. This exception occurs if the offset parameter is greater than the length of the array in the xtd::net::sockets::socket_async_event_args::buffer property. This exception also occurs if the count parameter is greater than the length of the array in the xtd::net::sockets::socket_async_event_args::buffer property minus the offset parameter. |
void xtd::net::sockets::socket_async_event_args::set_buffer | ( | const std::vector< byte_t > & | memory_buffer | ) |
Sets the region of memory to use as a buffer with an asynchronous socket method.
memory_buffer | The region of memory to use as a buffer with an asynchronous socket method. |
void xtd::net::sockets::socket_async_event_args::set_buffer | ( | size_t | offset, |
size_t | count | ||
) |
Sets the data buffer to use with an asynchronous socket method.
offset | The offset, in bytes, in the data buffer where the operation starts. |
count | The maximum amount of data, in bytes, to send or receive in the buffer. |
xtd::argument_out_of_range_exception | An argument was out of range. This exception occurs if the offset parameter is greater than the length of the array in the xtd::net::sockets::socket_async_event_args::buffer property. This exception also occurs if the count parameter is greater than the length of the array in the xtd::net::sockets::socket_async_event_args::buffer property minus the offset parameter. |
xtd::event<socket_async_event_args, xtd::delegate<void(const socket_async_event_args&)> > xtd::net::sockets::socket_async_event_args::completed |
The event used to complete an asynchronous operation.