Editare

Partajați prin


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.

public:
 SendPacketsElement(cli::array <System::Byte> ^ buffer);
public SendPacketsElement (byte[] buffer);
new System.Net.Sockets.SendPacketsElement : byte[] -> System.Net.Sockets.SendPacketsElement
Public Sub New (buffer As Byte())

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

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.

public:
 SendPacketsElement(System::String ^ filepath, long offset, int count, bool endOfPacket);
public SendPacketsElement (string filepath, long offset, int count, bool endOfPacket);
new System.Net.Sockets.SendPacketsElement : string * int64 * int * bool -> System.Net.Sockets.SendPacketsElement
Public Sub New (filepath As String, offset As Long, count As Integer, endOfPacket As Boolean)

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

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.

public:
 SendPacketsElement(System::String ^ filepath, int offset, int count, bool endOfPacket);
public SendPacketsElement (string filepath, int offset, int count, bool endOfPacket);
new System.Net.Sockets.SendPacketsElement : string * int * int * bool -> System.Net.Sockets.SendPacketsElement
Public Sub New (filepath As String, offset As Integer, count As Integer, endOfPacket As Boolean)

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

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.

public:
 SendPacketsElement(cli::array <System::Byte> ^ buffer, int offset, int count, bool endOfPacket);
public SendPacketsElement (byte[] buffer, int offset, int count, bool endOfPacket);
new System.Net.Sockets.SendPacketsElement : byte[] * int * int * bool -> System.Net.Sockets.SendPacketsElement
Public Sub New (buffer As Byte(), offset As Integer, count As Integer, endOfPacket As Boolean)

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

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.

public:
 SendPacketsElement(System::String ^ filepath, long offset, int count);
public SendPacketsElement (string filepath, long offset, int count);
new System.Net.Sockets.SendPacketsElement : string * int64 * int -> System.Net.Sockets.SendPacketsElement
Public Sub New (filepath As String, offset As Long, count As Integer)

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

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.

public:
 SendPacketsElement(System::String ^ filepath, int offset, int count);
public SendPacketsElement (string filepath, int offset, int count);
new System.Net.Sockets.SendPacketsElement : string * int * int -> System.Net.Sockets.SendPacketsElement
Public Sub New (filepath As String, offset As Integer, count As Integer)

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

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.

public:
 SendPacketsElement(System::IO::FileStream ^ fileStream, long offset, int count, bool endOfPacket);
public SendPacketsElement (System.IO.FileStream fileStream, long offset, int count, bool endOfPacket);
new System.Net.Sockets.SendPacketsElement : System.IO.FileStream * int64 * int * bool -> System.Net.Sockets.SendPacketsElement
Public Sub New (fileStream As FileStream, offset As Long, count As Integer, endOfPacket As Boolean)

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

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.

public:
 SendPacketsElement(cli::array <System::Byte> ^ buffer, int offset, int count);
public SendPacketsElement (byte[] buffer, int offset, int count);
new System.Net.Sockets.SendPacketsElement : byte[] * int * int -> System.Net.Sockets.SendPacketsElement
Public Sub New (buffer As Byte(), offset As Integer, count As Integer)

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

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.

public:
 SendPacketsElement(ReadOnlyMemory<System::Byte> buffer, bool endOfPacket);
public SendPacketsElement (ReadOnlyMemory<byte> buffer, bool endOfPacket);
new System.Net.Sockets.SendPacketsElement : ReadOnlyMemory<byte> * bool -> System.Net.Sockets.SendPacketsElement
Public Sub New (buffer As ReadOnlyMemory(Of Byte), endOfPacket As Boolean)

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

SendPacketsElement(String)

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

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

public:
 SendPacketsElement(System::String ^ filepath);
public SendPacketsElement (string filepath);
new System.Net.Sockets.SendPacketsElement : string -> System.Net.Sockets.SendPacketsElement
Public Sub New (filepath As String)

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

SendPacketsElement(ReadOnlyMemory<Byte>)

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

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

public:
 SendPacketsElement(ReadOnlyMemory<System::Byte> buffer);
public SendPacketsElement (ReadOnlyMemory<byte> buffer);
new System.Net.Sockets.SendPacketsElement : ReadOnlyMemory<byte> -> System.Net.Sockets.SendPacketsElement
Public Sub New (buffer As ReadOnlyMemory(Of Byte))

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

SendPacketsElement(FileStream)

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

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

public:
 SendPacketsElement(System::IO::FileStream ^ fileStream);
public SendPacketsElement (System.IO.FileStream fileStream);
new System.Net.Sockets.SendPacketsElement : System.IO.FileStream -> System.Net.Sockets.SendPacketsElement
Public Sub New (fileStream As 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

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.

public:
 SendPacketsElement(System::IO::FileStream ^ fileStream, long offset, int count);
public SendPacketsElement (System.IO.FileStream fileStream, long offset, int count);
new System.Net.Sockets.SendPacketsElement : System.IO.FileStream * int64 * int -> System.Net.Sockets.SendPacketsElement
Public Sub New (fileStream As FileStream, offset As Long, count As Integer)

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