SendPacketsElement Constructors

Definition

Initializes a new instance of the SendPacketsElement class.

Overloads

SendPacketsElement(Byte[])

Initializes a new instance of the SendPacketsElement class using the specified buffer.

SendPacketsElement(String, Int64, Int32, Boolean)

Initializes a new instance of the SendPacketsElement 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.

SendPacketsElement(String, Int32, Int32, Boolean)

Initializes a new instance of the SendPacketsElement 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.

SendPacketsElement(Byte[], Int32, Int32, Boolean)

Initializes a new instance of the SendPacketsElement 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.

SendPacketsElement(String, Int64, Int32)

Initializes a new instance of the SendPacketsElement class using the specified range of the file.

SendPacketsElement(String, Int32, Int32)

Initializes a new instance of the SendPacketsElement class using the specified range of the file.

SendPacketsElement(FileStream, Int64, Int32, Boolean)

Initializes a new instance of the SendPacketsElement class using the specified range of a FileStream object with an option to combine this element with the next element in a single send request from the sockets layer to the transport.

SendPacketsElement(Byte[], Int32, Int32)

Initializes a new instance of the SendPacketsElement class using the specified range of the buffer.

SendPacketsElement(ReadOnlyMemory<Byte>, Boolean)

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

SendPacketsElement(String)

Initializes a new instance of the SendPacketsElement class using the specified file.

SendPacketsElement(ReadOnlyMemory<Byte>)

Initializes a new instance of the SendPacketsElement class using the specified buffer.

SendPacketsElement(FileStream)

Initializes a new instance of the SendPacketsElement class using the specified FileStream object.

SendPacketsElement(FileStream, Int64, Int32)

Initializes a new instance of the SendPacketsElement class using the specified range of a FileStream object.

SendPacketsElement(Byte[])

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement class using the specified buffer.

C#
public SendPacketsElement(byte[] buffer);

Parameters

buffer
Byte[]

A byte array of data to send using the SendPacketsAsync(SocketAsyncEventArgs) method.

Exceptions

The buffer parameter cannot be null.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

See also

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1

SendPacketsElement(String, Int64, Int32, Boolean)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement 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.

C#
public SendPacketsElement(string filepath, long offset, int count, bool endOfPacket);

Parameters

filepath
String

The filename of the file to be transmitted using the SendPacketsAsync(SocketAsyncEventArgs) method.

offset
Int64

The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the filepath parameter.

count
Int32

The number of bytes to send starting from the offset parameter. If count is zero, the entire file is sent.

endOfPacket
Boolean

Specifies 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.

Exceptions

The filepath parameter cannot be null.

The offset and count parameters must be greater than or equal to zero.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

Universal Naming Convention (UNC) paths are supported by the filepath parameter. If the file is in the current working directory, no path information needs to be specified.

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10

SendPacketsElement(String, Int32, Int32, Boolean)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement 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.

C#
public SendPacketsElement(string filepath, int offset, int count, bool endOfPacket);

Parameters

filepath
String

The filename of the file to be transmitted using the SendPacketsAsync(SocketAsyncEventArgs) method.

offset
Int32

The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the filepath parameter.

count
Int32

The number of bytes to send starting from the offset parameter. If count is zero, the entire file is sent.

endOfPacket
Boolean

A Boolean value that specifies 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.

Exceptions

The filepath parameter cannot be null.

The offset and count parameters must be greater than or equal to zero.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

Universal Naming Convention (UNC) paths are supported by the filepath parameter. If the file is in the current working directory, no path information needs to be specified.

See also

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1

SendPacketsElement(Byte[], Int32, Int32, Boolean)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement 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.

C#
public SendPacketsElement(byte[] buffer, int offset, int count, bool endOfPacket);

Parameters

buffer
Byte[]

A byte array of data to send using the SendPacketsAsync(SocketAsyncEventArgs) method.

offset
Int32

The 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.

count
Int32

The number bytes to send starting from the offset parameter. If count is zero, no bytes are sent.

endOfPacket
Boolean

A Boolean value that specifies 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.

Exceptions

The buffer parameter cannot be null.

The offset and count parameters must be greater than or equal to zero.

The offset and count must be less than the size of the buffer.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

See also

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1

SendPacketsElement(String, Int64, Int32)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement class using the specified range of the file.

C#
public SendPacketsElement(string filepath, long offset, int count);

Parameters

filepath
String

The filename of the file to be transmitted using the SendPacketsAsync(SocketAsyncEventArgs) method.

offset
Int64

The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the filepath parameter.

count
Int32

The number of bytes to send starting from the offset. If count is zero, the entire file is sent.

Exceptions

The filepath parameter cannot be null.

The offset and count parameters must be greater than or equal to zero.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

Universal Naming Convention (UNC) paths are supported by the filepath parameter. If the file is in the current working directory, no path information needs to be specified.

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10

SendPacketsElement(String, Int32, Int32)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement class using the specified range of the file.

C#
public SendPacketsElement(string filepath, int offset, int count);

Parameters

filepath
String

The filename of the file to be transmitted using the SendPacketsAsync(SocketAsyncEventArgs) method.

offset
Int32

The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the filepath parameter.

count
Int32

The number of bytes to send starting from the offset parameter. If count is zero, the entire file is sent.

Exceptions

The filepath parameter cannot be null.

The offset and count parameters must be greater than or equal to zero.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

Universal Naming Convention (UNC) paths are supported by the filepath parameter. If the file is in the current working directory, no path information needs to be specified.

See also

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1

SendPacketsElement(FileStream, Int64, Int32, Boolean)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement class using the specified range of a FileStream object with an option to combine this element with the next element in a single send request from the sockets layer to the transport.

C#
public SendPacketsElement(System.IO.FileStream fileStream, long offset, int count, bool endOfPacket);

Parameters

fileStream
FileStream

The file to be transmitted using the SendPacketsAsync(SocketAsyncEventArgs) method.

offset
Int64

TThe offset, in bytes, from the beginning of the file to the location in the file to start sending the bytes in the file.

count
Int32

The number of bytes to send starting from the offset parameter. If count is zero, the entire file is sent.

endOfPacket
Boolean

Specifies 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.

Exceptions

The fileStream parameter must have been opened for asynchronous reading and writing.

The fileStream parameter cannot be null.

The offset and count parameters must be greater than or equal to zero.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10

SendPacketsElement(Byte[], Int32, Int32)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement class using the specified range of the buffer.

C#
public SendPacketsElement(byte[] buffer, int offset, int count);

Parameters

buffer
Byte[]

A byte array of data to send using the SendPacketsAsync(SocketAsyncEventArgs) method.

offset
Int32

The 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.

count
Int32

The number of bytes to send starting from the offset parameter. If count is zero, no bytes are sent.

Exceptions

The buffer parameter cannot be null.

The offset and count parameters must be greater than or equal to zero.

The offset and count must be less than the size of the buffer.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

See also

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1

SendPacketsElement(ReadOnlyMemory<Byte>, Boolean)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

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

C#
public SendPacketsElement(ReadOnlyMemory<byte> buffer, bool endOfPacket);

Parameters

buffer
ReadOnlyMemory<Byte>

A ReadOnlyMemory<T> of bytes to send using the SendPacketsAsync(SocketAsyncEventArgs) method.

endOfPacket
Boolean

Specifies 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 SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET 6, 7, 8, 9, 10

SendPacketsElement(String)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement class using the specified file.

C#
public SendPacketsElement(string filepath);

Parameters

filepath
String

The filename of the file to be transmitted using the SendPacketsAsync(SocketAsyncEventArgs) method.

Exceptions

The filepath parameter cannot be null.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

Universal Naming Convention (UNC) paths are supported by the filepath parameter. If the file is in the current working directory, no path information needs to be specified.

See also

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1

SendPacketsElement(ReadOnlyMemory<Byte>)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement class using the specified buffer.

C#
public SendPacketsElement(ReadOnlyMemory<byte> buffer);

Parameters

buffer
ReadOnlyMemory<Byte>

A ReadOnlyMemory<T> of bytes to send using the SendPacketsAsync(SocketAsyncEventArgs) method.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET 6, 7, 8, 9, 10

SendPacketsElement(FileStream)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement class using the specified FileStream object.

C#
public SendPacketsElement(System.IO.FileStream fileStream);

Parameters

fileStream
FileStream

The file to be transmitted using the SendPacketsAsync(SocketAsyncEventArgs) method.

Exceptions

fileStream is not open for asynchronous reading and writing.

fileStream cannot be null.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10

SendPacketsElement(FileStream, Int64, Int32)

Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs
Source:
SendPacketsElement.cs

Initializes a new instance of the SendPacketsElement class using the specified range of a FileStream object.

C#
public SendPacketsElement(System.IO.FileStream fileStream, long offset, int count);

Parameters

fileStream
FileStream

The file to be transmitted using the SendPacketsAsync(SocketAsyncEventArgs) method.

offset
Int64

The offset, in bytes, from the beginning of the file to the location in the file to start sending the bytes in the file.

count
Int32

The number of bytes to send starting from the offset. If count is zero, the entire file is sent.

Exceptions

The fileStream parameter must have been opened for asynchronous reading and writing.

The fileStream parameter cannot be null.

The offset and count parameters must be greater than or equal to zero.

Remarks

The SendPacketsElement class is used with the SocketAsyncEventArgs.SendPacketsElements property to get or set a data buffer or file to be sent using the Socket.SendPacketsAsync method.

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10