using System;
namespace System.Net.Sockets
{
/// Represents an element in a array.
// Token: 0x020001E3 RID: 483
public class SendPacketsElement
{
/// Initializes a new instance of the class using the specified buffer.
/// A byte array of data to send using the method.
/// The parameter cannot be null
// Token: 0x06000F91 RID: 3985 RVA: 0x0002AB34 File Offset: 0x00028D34
public SendPacketsElement(byte[] buffer)
: this(buffer, 0, (buffer == null) ? 0 : buffer.Length)
{
}
/// Initializes a new instance of the class using the specified buffer, buffer offset, and count.
/// A byte array of data to send using the method.
/// The offset, in bytes, from the beginning of the to the location in the to start sending the data specified in the parameter.
/// The number of bytes to send starting from the parameter. If is zero, no bytes are sent.
/// The parameter cannot be null
/// The and parameters must be greater than or equal to zero. The and must be less than the size of the buffer
// Token: 0x06000F92 RID: 3986 RVA: 0x0002AB50 File Offset: 0x00028D50
public SendPacketsElement(byte[] buffer, int offset, int count)
: this(buffer, offset, count, false)
{
}
/// Initializes a new instance of the class using the specified buffer, buffer offset, and count with an option to combine this element with the next element in a single send request from the sockets layer to the transport.
/// A byte array of data to send using the method.
/// The offset, in bytes, from the beginning of the to the location in the to start sending the data specified in the parameter.
/// The number bytes to send starting from the parameter. If is zero, no bytes are sent.
/// 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.
/// The parameter cannot be null
/// The and parameters must be greater than or equal to zero. The and must be less than the size of the buffer
// Token: 0x06000F93 RID: 3987 RVA: 0x0002AB5C File Offset: 0x00028D5C
public SendPacketsElement(byte[] buffer, int offset, int count, bool endOfPacket)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
int num = buffer.Length;
if (offset < 0 || offset >= num)
{
throw new ArgumentOutOfRangeException("offset");
}
if (count < 0 || offset + count >= num)
{
throw new ArgumentOutOfRangeException("count");
}
this.Buffer = buffer;
this.Offset = offset;
this.Count = count;
this.EndOfPacket = endOfPacket;
this.FilePath = null;
}
/// Initializes a new instance of the class using the specified file.
/// The filename of the file to be transmitted using the method.
/// The parameter cannot be null
// Token: 0x06000F94 RID: 3988 RVA: 0x0002ABDC File Offset: 0x00028DDC
public SendPacketsElement(string filepath)
: this(filepath, 0, 0, false)
{
}
/// Initializes a new instance of the class using the specified filename path, offset, and count.
/// The filename of the file to be transmitted using the method.
/// The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the parameter.
/// The number of bytes to send starting from the parameter. If is zero, the entire file is sent.
/// The parameter cannot be null
/// The and parameters must be greater than or equal to zero. The and must be less than the size of the file indicated by the parameter.
// Token: 0x06000F95 RID: 3989 RVA: 0x0002ABE8 File Offset: 0x00028DE8
public SendPacketsElement(string filepath, int offset, int count)
: this(filepath, offset, count, false)
{
}
/// Initializes a new instance of the class using the specified filename path, buffer offset, and count with an option to combine this element with the next element in a single send request from the sockets layer to the transport.
/// The filename of the file to be transmitted using the method.
/// The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the parameter.
/// The number of bytes to send starting from the parameter. If is zero, the entire file is sent.
/// 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.
/// The parameter cannot be null
/// The and parameters must be greater than or equal to zero. The and must be less than the size of the file indicated by the parameter.
// Token: 0x06000F96 RID: 3990 RVA: 0x0002ABF4 File Offset: 0x00028DF4
public SendPacketsElement(string filepath, int offset, int count, bool endOfPacket)
{
if (filepath == null)
{
throw new ArgumentNullException("filepath");
}
this.Buffer = null;
this.Offset = offset;
this.Count = count;
this.EndOfPacket = endOfPacket;
this.FilePath = filepath;
}
/// Gets the buffer to be sent if the class was initialized with a parameter.
/// The byte buffer to send if the class was initialized with a parameter.
// Token: 0x17000553 RID: 1363
// (get) Token: 0x06000F97 RID: 3991 RVA: 0x0002AC3C File Offset: 0x00028E3C
// (set) Token: 0x06000F98 RID: 3992 RVA: 0x0002AC44 File Offset: 0x00028E44
public byte[] Buffer { get; private set; }
/// Gets the count of bytes to be sent.
/// The count of bytes to send if the class was initialized with a parameter.
// Token: 0x17000554 RID: 1364
// (get) Token: 0x06000F99 RID: 3993 RVA: 0x0002AC50 File Offset: 0x00028E50
// (set) Token: 0x06000F9A RID: 3994 RVA: 0x0002AC58 File Offset: 0x00028E58
public int Count { get; private set; }
/// Gets a Boolean 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.
/// A Boolean value that indicates if this element should not be combined with the next element in a single send request.
// Token: 0x17000555 RID: 1365
// (get) Token: 0x06000F9B RID: 3995 RVA: 0x0002AC64 File Offset: 0x00028E64
// (set) Token: 0x06000F9C RID: 3996 RVA: 0x0002AC6C File Offset: 0x00028E6C
public bool EndOfPacket { get; private set; }
/// Gets the filename of the file to send if the class was initialized with a parameter.
/// The filename of the file to send if the class was initialized with a parameter.
// Token: 0x17000556 RID: 1366
// (get) Token: 0x06000F9D RID: 3997 RVA: 0x0002AC78 File Offset: 0x00028E78
// (set) Token: 0x06000F9E RID: 3998 RVA: 0x0002AC80 File Offset: 0x00028E80
public string FilePath { get; private set; }
/// 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.
/// 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.
// Token: 0x17000557 RID: 1367
// (get) Token: 0x06000F9F RID: 3999 RVA: 0x0002AC8C File Offset: 0x00028E8C
// (set) Token: 0x06000FA0 RID: 4000 RVA: 0x0002AC94 File Offset: 0x00028E94
public int Offset { get; private set; }
}
}