138 lines
11 KiB
C#
138 lines
11 KiB
C#
using System;
|
|
|
|
namespace System.Net.Sockets
|
|
{
|
|
/// <summary>Represents an element in a <see cref="T:System.Net.Sockets.SendPacketsElement" /> array.</summary>
|
|
// Token: 0x020001E3 RID: 483
|
|
public class SendPacketsElement
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class using the specified buffer.</summary>
|
|
/// <param name="buffer">A byte array of data to send using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
|
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter cannot be null</exception>
|
|
// Token: 0x06000F91 RID: 3985 RVA: 0x0002AB34 File Offset: 0x00028D34
|
|
public SendPacketsElement(byte[] buffer)
|
|
: this(buffer, 0, (buffer == null) ? 0 : buffer.Length)
|
|
{
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class using the specified buffer, buffer offset, and count.</summary>
|
|
/// <param name="buffer">A byte array of data to send using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
|
/// <param name="offset">The offset, in bytes, from the beginning of the <paramref name="buffer" /> to the location in the <paramref name="buffer" /> to start sending the data specified in the <paramref name="buffer" /> parameter.</param>
|
|
/// <param name="count">The number of bytes to send starting from the <paramref name="offset" /> parameter. If <paramref name="count" /> is zero, no bytes are sent.</param>
|
|
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter cannot be null</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> and <paramref name="count" /> parameters must be greater than or equal to zero. The <paramref name="offset" /> and <paramref name="count" /> must be less than the size of the buffer</exception>
|
|
// Token: 0x06000F92 RID: 3986 RVA: 0x0002AB50 File Offset: 0x00028D50
|
|
public SendPacketsElement(byte[] buffer, int offset, int count)
|
|
: this(buffer, offset, count, false)
|
|
{
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> 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. </summary>
|
|
/// <param name="buffer">A byte array of data to send using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
|
/// <param name="offset">The offset, in bytes, from the beginning of the <paramref name="buffer" /> to the location in the <paramref name="buffer" /> to start sending the data specified in the <paramref name="buffer" /> parameter.</param>
|
|
/// <param name="count">The number bytes to send starting from the <paramref name="offset" /> parameter. If <paramref name="count" /> is zero, no bytes are sent.</param>
|
|
/// <param name="endOfPacket">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. </param>
|
|
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter cannot be null</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> and <paramref name="count" /> parameters must be greater than or equal to zero. The <paramref name="offset" /> and <paramref name="count" /> must be less than the size of the buffer</exception>
|
|
// 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;
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class using the specified file.</summary>
|
|
/// <param name="filepath">The filename of the file to be transmitted using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
|
/// <exception cref="T:System.ArgumentNullException">The <paramref name="filepath" /> parameter cannot be null</exception>
|
|
// Token: 0x06000F94 RID: 3988 RVA: 0x0002ABDC File Offset: 0x00028DDC
|
|
public SendPacketsElement(string filepath)
|
|
: this(filepath, 0, 0, false)
|
|
{
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class using the specified filename path, offset, and count.</summary>
|
|
/// <param name="filepath">The filename of the file to be transmitted using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
|
/// <param name="offset">The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the <paramref name="filepath" /> parameter.</param>
|
|
/// <param name="count">The number of bytes to send starting from the <paramref name="offset" /> parameter. If <paramref name="count" /> is zero, the entire file is sent. </param>
|
|
/// <exception cref="T:System.ArgumentNullException">The <paramref name="filepath" /> parameter cannot be null</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> and <paramref name="count" /> parameters must be greater than or equal to zero. The <paramref name="offset" /> and <paramref name="count" /> must be less than the size of the file indicated by the <paramref name="filepath" /> parameter.</exception>
|
|
// Token: 0x06000F95 RID: 3989 RVA: 0x0002ABE8 File Offset: 0x00028DE8
|
|
public SendPacketsElement(string filepath, int offset, int count)
|
|
: this(filepath, offset, count, false)
|
|
{
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> 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. </summary>
|
|
/// <param name="filepath">The filename of the file to be transmitted using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
|
/// <param name="offset">The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the <paramref name="filepath" /> parameter.</param>
|
|
/// <param name="count">The number of bytes to send starting from the <paramref name="offset" /> parameter. If <paramref name="count" /> is zero, the entire file is sent.</param>
|
|
/// <param name="endOfPacket">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.</param>
|
|
/// <exception cref="T:System.ArgumentNullException">The <paramref name="filepath" /> parameter cannot be null</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> and <paramref name="count" /> parameters must be greater than or equal to zero. The <paramref name="offset" /> and <paramref name="count" /> must be less than the size of the file indicated by the <paramref name="filepath" /> parameter.</exception>
|
|
// 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;
|
|
}
|
|
|
|
/// <summary>Gets the buffer to be sent if the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class was initialized with a <paramref name="buffer" /> parameter.</summary>
|
|
/// <returns>The byte buffer to send if the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class was initialized with a <paramref name="buffer" /> parameter.</returns>
|
|
// 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; }
|
|
|
|
/// <summary>Gets the count of bytes to be sent. </summary>
|
|
/// <returns>The count of bytes to send if the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class was initialized with a <paramref name="count" /> parameter.</returns>
|
|
// 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; }
|
|
|
|
/// <summary>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.</summary>
|
|
/// <returns>A Boolean value that indicates if this element should not be combined with the next element in a single send request.</returns>
|
|
// 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; }
|
|
|
|
/// <summary>Gets the filename of the file to send if the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class was initialized with a <paramref name="filepath" /> parameter.</summary>
|
|
/// <returns>The filename of the file to send if the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class was initialized with a <paramref name="filepath" /> parameter.</returns>
|
|
// 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; }
|
|
|
|
/// <summary>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. </summary>
|
|
/// <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.</returns>
|
|
// 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; }
|
|
}
|
|
}
|