xtd 0.2.0
Loading...
Searching...
No Matches
xtd::net::sockets::send_packets_element Class Reference
Inheritance diagram for xtd::net::sockets::send_packets_element:
xtd::object

Definition

Represents an element in a xtd::net::sockets::send_packets_element array.

Represents an element in a xtd::net::sockets::send_packets_element array.
Definition send_packets_element.hpp:41
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:42
#define core_export_
Define shared library export.
Definition core_export.hpp:13
Inheritance
xtd::objectxtd::net::sockets::send_packets_element
Header
#include <xtd/net/sockets/send_packets_element>
Namespace
xtd::net::sockets
Library
xtd.core
Remarks
The xtd::net::sockets::send_packets_element class is used to enhance the xtd::net::sockets::socket class for use by server applications that use asynchronous network I/O to achieve the highest performance. The xtd::net::sockets::send_packets_element class is used with the xtd::net::sockets::socket_async_event_args::send_packets_elements property to get or set a data buffer or file to be sent using the xtd::net::sockets::socket::send_packets_async method.

Public Aliases

using ifstream_ref = std::reference_wrapper< std::ifstream >
 Represent ta std::ifstream reference.
 

Public Constructors

 send_packets_element ()=default
 Initializes a new instance of the xtd::net::sockets::send_packets_element class.
 
 send_packets_element (const std::vector< xtd::byte > &buffer)
 Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified buffer.
 
 send_packets_element (const xtd::string &file_path, size_t offset, size_t count, bool end_of_packet)
 Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified range of the file with an option to combine this element with the next element in a single send request from the sockets layer to the transport.
 
 send_packets_element (const std::vector< xtd::byte > &buffer, size_t offset, size_t count, bool end_of_packet)
 Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified range of the buffer with an option to combine this element with the next element in a single send request from the sockets layer to the transport.
 
 send_packets_element (const xtd::string &file_path, size_t offset, size_t count)
 Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified range of the file with an option to combine this element with the next element in a single send request from the sockets layer to the transport.
 
 send_packets_element (std::ifstream &file_stream, size_t offset, size_t count, bool end_of_packet)
 Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified range of the buffer with an option to combine this element with the next element in a single send request from the sockets layer to the transport.
 
 send_packets_element (const std::vector< xtd::byte > &buffer, size_t offset, size_t count)
 Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified range of the buffer with an option to combine this element with the next element in a single send request from the sockets layer to the transport.
 
 send_packets_element (const xtd::string &file_path)
 Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified file.
 
 send_packets_element (std::ifstream &file_stream)
 Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified FileStream object.
 

Public Properties

std::vector< xtd::bytebuffer () const noexcept
 Gets the buffer to be sent if the xtd::net::sockets::send_packets_element object was initialized with a buffer parameter.
 
size_t count () const noexcept
 Gets the count of bytes to be sent.
 
bool end_of_packet () const noexcept
 Gets a bool value that indicates if this element should not be combined with the next element in a single send request from the sockets layer to the transport.
 
const xtd::stringfile_path () const noexcept
 Gets the filename of the file to send if the xtd::net::sockets::send_packets_element object was initialized with a file_path parameter.
 
std::optional< ifstream_reffile_stream () const noexcept
 Gets the object representation of the file to send if the xtd::net::sockets::send_packets_element object was initialized with a std::ifstream parameter.
 
size_t offset () const noexcept
 Gets the offset, in bytes, from the beginning of the data buffer or file to the location in the buffer or file to start sending the data.
 

Additional Inherited Members

- 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.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const noexcept
 Returns a xtd::string that represents the current object.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<typename object_a_t , typename object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

Member Typedef Documentation

◆ ifstream_ref

using xtd::net::sockets::send_packets_element::ifstream_ref = std::reference_wrapper<std::ifstream>

Represent ta std::ifstream reference.

Constructor & Destructor Documentation

◆ send_packets_element() [1/9]

xtd::net::sockets::send_packets_element::send_packets_element ( )
default

Initializes a new instance of the xtd::net::sockets::send_packets_element class.

◆ send_packets_element() [2/9]

xtd::net::sockets::send_packets_element::send_packets_element ( const std::vector< xtd::byte > &  buffer)
explicit

Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified buffer.

Parameters
bufferA byte array of data to send using the xtd::net::sockets::socket::send_packets_async method.
Remarks
The xtd::net::sockets::send_packets_element class is used with the xtd::net::sockets::socket::socket_async_event_args::send_packets_elements property to get or set a data buffer or file to be sent using the xtd::net::sockets::socket::socket::send_packets_async method.

◆ send_packets_element() [3/9]

xtd::net::sockets::send_packets_element::send_packets_element ( const xtd::string file_path,
size_t  offset,
size_t  count,
bool  end_of_packet 
)

Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified range of the file with an option to combine this element with the next element in a single send request from the sockets layer to the transport.

Parameters
file_pathThe filename of the file to be transmitted using the xtd::net::sockets::socket::send_packets_async method.
offsetThe offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the file_path parameter.
countThe number of bytes to send starting from the offset parameter. If count is zero, the entire file is sent.
end_of_packetSpecifies that this element should not be combined with the next element in a single send request from the sockets layer to the transport. This flag is used for granular control of the content of each message on a datagram or message-oriented socket.
Remarks
The xtd::net::sockets::send_packets_element class is used with the xtd::net::sockets::socket::socket_async_event_args::send_packets_elements property to get or set a data buffer or file to be sent using the xtd::net::sockets::socket::socket::send_packets_async method.
Universal Naming Convention (UNC) paths are supported by the file_path parameter. If the file is in the current working directory, no path information needs to be specified.

◆ send_packets_element() [4/9]

xtd::net::sockets::send_packets_element::send_packets_element ( const std::vector< xtd::byte > &  buffer,
size_t  offset,
size_t  count,
bool  end_of_packet 
)

Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified range of the buffer with an option to combine this element with the next element in a single send request from the sockets layer to the transport.

Parameters
bufferA byte array of data to send using the xtd::net::sockets::socket::send_packets_async method.
offsetThe offset, in bytes, from the beginning of the buffer to the location in the buffer to start sending the data specified in the buffer parameter.
countThe number bytes to send starting from the offset parameter. If count is zero, no bytes are sent.
end_of_packetSpecifies that this element should not be combined with the next element in a single send request from the sockets layer to the transport. This flag is used for granular control of the content of each message on a datagram or message-oriented socket.
Remarks
The xtd::net::sockets::send_packets_element class is used with the xtd::net::sockets::socket::socket_async_event_args::send_packets_elements property to get or set a data buffer or file to be sent using the xtd::net::sockets::socket::socket::send_packets_async method.

◆ send_packets_element() [5/9]

xtd::net::sockets::send_packets_element::send_packets_element ( const xtd::string file_path,
size_t  offset,
size_t  count 
)

Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified range of the file with an option to combine this element with the next element in a single send request from the sockets layer to the transport.

Parameters
file_pathThe filename of the file to be transmitted using the xtd::net::sockets::socket::send_packets_async method.
offsetThe offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the file_path parameter.
countThe number of bytes to send starting from the offset parameter. If count is zero, the entire file is sent.
Remarks
The xtd::net::sockets::send_packets_element class is used with the xtd::net::sockets::socket::socket_async_event_args::send_packets_elements property to get or set a data buffer or file to be sent using the xtd::net::sockets::socket::socket::send_packets_async method.
Universal Naming Convention (UNC) paths are supported by the file_path parameter. If the file is in the current working directory, no path information needs to be specified.

◆ send_packets_element() [6/9]

xtd::net::sockets::send_packets_element::send_packets_element ( std::ifstream &  file_stream,
size_t  offset,
size_t  count,
bool  end_of_packet 
)

Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified range of the buffer with an option to combine this element with the next element in a single send request from the sockets layer to the transport.

Parameters
file_streamThe file to be transmitted using the xtd::net::sockets::socket::send_packets_async method.
offsetThe offset, in bytes, from the beginning of the file to the location in the file to start sending the bytes in the file.
countThe number of bytes to send starting from the offset parameter. If count is zero, the entire file is sent.
end_of_packetSpecifies that this element should not be combined with the next element in a single send request from the sockets layer to the transport. This flag is used for granular control of the content of each message on a datagram or message-oriented socket.
Remarks
The xtd::net::sockets::send_packets_element class is used with the xtd::net::sockets::socket::socket_async_event_args::send_packets_elements property to get or set a data buffer or file to be sent using the xtd::net::sockets::socket::socket::send_packets_async method.

◆ send_packets_element() [7/9]

xtd::net::sockets::send_packets_element::send_packets_element ( const std::vector< xtd::byte > &  buffer,
size_t  offset,
size_t  count 
)

Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified range of the buffer with an option to combine this element with the next element in a single send request from the sockets layer to the transport.

Parameters
bufferA byte array of data to send using the xtd::net::sockets::socket::send_packets_async method.
offsetThe offset, in bytes, from the beginning of the buffer to the location in the buffer to start sending the data specified in the buffer parameter.
countThe number bytes to send starting from the offset parameter. If count is zero, no bytes are sent.
Remarks
The xtd::net::sockets::send_packets_element class is used with the xtd::net::sockets::socket::socket_async_event_args::send_packets_elements property to get or set a data buffer or file to be sent using the xtd::net::sockets::socket::socket::send_packets_async method.

◆ send_packets_element() [8/9]

xtd::net::sockets::send_packets_element::send_packets_element ( const xtd::string file_path)
explicit

Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified file.

Parameters
file_pathThe filename of the file to be transmitted using the xtd::net::sockets::socket::send_packets_async method.
Remarks
The xtd::net::sockets::send_packets_element class is used with the xtd::net::sockets::socket::socket_async_event_args::send_packets_elements property to get or set a data buffer or file to be sent using the xtd::net::sockets::socket::socket::send_packets_async method.
Universal Naming Convention (UNC) paths are supported by the file_path parameter. If the file is in the current working directory, no path information needs to be specified.

◆ send_packets_element() [9/9]

xtd::net::sockets::send_packets_element::send_packets_element ( std::ifstream &  file_stream)
explicit

Initializes a new instance of the xtd::net::sockets::send_packets_element class using the specified FileStream object.

Parameters
file_streamThe file to be transmitted using the xtd::net::sockets::socket::send_packets_async method.
Remarks
The xtd::net::sockets::send_packets_element class is used with the xtd::net::sockets::socket::socket_async_event_args::send_packets_elements property to get or set a data buffer or file to be sent using the xtd::net::sockets::socket::socket::send_packets_async method.

Member Function Documentation

◆ buffer()

std::vector< xtd::byte > xtd::net::sockets::send_packets_element::buffer ( ) const
noexcept

Gets the buffer to be sent if the xtd::net::sockets::send_packets_element object was initialized with a buffer parameter.

Returns
The byte buffer to send if the xtd::net::sockets::send_packets_element object was initialized with a buffer parameter.
Remarks
The default value for the xtd::net::sockets::send_packets_element::buffer property is empty if the xtd::net::sockets::send_packets_element object was not initialized with a buffer parameter.

◆ count()

size_t xtd::net::sockets::send_packets_element::count ( ) const
noexcept

Gets the count of bytes to be sent.

Returns
The count of bytes to send if the xtd::net::sockets::send_packets_element class was initialized with a count parameter.
Remarks
The default value for the xtd::net::sockets::send_packets_element::count property is zero if the xtd::net::sockets::send_packets_element class was not initialized with a count parameter.
If Count is zero for a file, the entire file is sent. If xtd::net::sockets::send_packets_element::count is zero for a buffer, no bytes are sent.

◆ end_of_packet()

bool xtd::net::sockets::send_packets_element::end_of_packet ( ) const
noexcept

Gets a bool value that indicates if this element should not be combined with the next element in a single send request from the sockets layer to the transport.

Returns
A bool value that indicates if this element should not be combined with the next element in a single send request.
Remarks
The default value for the xtd::net::sockets::send_packets_element::end_of_packet property is false if the xtd::net::sockets::send_packets_element class was not initialized with an end_of_packet parameter set to true.

◆ file_path()

const xtd::string & xtd::net::sockets::send_packets_element::file_path ( ) const
noexcept

Gets the filename of the file to send if the xtd::net::sockets::send_packets_element object was initialized with a file_path parameter.

Returns
The filename of the file to send if the xtd::net::sockets::send_packets_element object was initialized with a file_path parameter.
Remarks
Universal Naming Convention (UNC) paths are supported by the xtd::net::sockets::send_packets_element::file_path property. If the file is in the current working directory, no path information needs to be specified.
The default value for the xtd::net::sockets::send_packets_element::file_path property is empty if the xtd::net::sockets::send_packets_element object was not initialized with a file_path parameter.

◆ file_stream()

std::optional< ifstream_ref > xtd::net::sockets::send_packets_element::file_stream ( ) const
noexcept

Gets the object representation of the file to send if the xtd::net::sockets::send_packets_element object was initialized with a std::ifstream parameter.

Remarks
An object representation of the file to send if the xtd::net::sockets::send_packets_element object was initialized with a std::ifstream parameter.
The default value for the xtd::net::sockets::send_packets_element::file_stream property is empty if the xtd::net::sockets::send_packets_element object was not initialized with a file_stream parameter.

◆ offset()

size_t xtd::net::sockets::send_packets_element::offset ( ) const
noexcept

Gets the offset, in bytes, from the beginning of the data buffer or file to the location in the buffer or file to start sending the data.

Returns
The offset, in bytes, from the beginning of the data buffer or file to the location in the buffer or file to start sending the data.
Remarks
The default value for the xtd::net::sockets::send_packets_element::offset property is zero if the xtd::net::sockets::send_packets_element class was not initialized with an offset parameter.

The documentation for this class was generated from the following file: