using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Threading;
namespace System.Net.Sockets
{
/// Implements the Berkeley sockets interface.
// Token: 0x020001E4 RID: 484
public class Socket : IDisposable
{
// Token: 0x06000FA1 RID: 4001 RVA: 0x0002ACA0 File Offset: 0x00028EA0
private Socket(AddressFamily family, SocketType type, ProtocolType proto, IntPtr sock)
{
this.address_family = family;
this.socket_type = type;
this.protocol_type = proto;
this.socket = sock;
this.connected = true;
}
/// Initializes a new instance of the class using the specified value returned from .
/// The socket information returned by .
// Token: 0x06000FA2 RID: 4002 RVA: 0x0002AD14 File Offset: 0x00028F14
[global::System.MonoTODO]
public Socket(SocketInformation socketInformation)
{
throw new NotImplementedException("SocketInformation not figured out yet");
}
/// Initializes a new instance of the class using the specified address family, socket type and protocol.
/// One of the values.
/// One of the values.
/// One of the values.
/// The combination of , , and results in an invalid socket.
// Token: 0x06000FA3 RID: 4003 RVA: 0x0002AD70 File Offset: 0x00028F70
public Socket(AddressFamily family, SocketType type, ProtocolType proto)
{
if (family == AddressFamily.Unspecified)
{
throw new ArgumentException("family");
}
this.address_family = family;
this.socket_type = type;
this.protocol_type = proto;
int num;
this.socket = this.Socket_internal(family, type, proto, out num);
if (num != 0)
{
throw new SocketException(num);
}
}
// Token: 0x06000FA4 RID: 4004 RVA: 0x0002AE04 File Offset: 0x00029004
static Socket()
{
Socket.CheckProtocolSupport();
}
// Token: 0x06000FA5 RID: 4005 RVA: 0x0002AE18 File Offset: 0x00029018
private static void AddSockets(ArrayList sockets, IList list, string name)
{
if (list != null)
{
foreach (object obj in list)
{
Socket socket = (Socket)obj;
if (socket == null)
{
throw new ArgumentNullException("name", "Contains a null element");
}
sockets.Add(socket);
}
}
sockets.Add(null);
}
// Token: 0x06000FA6 RID: 4006
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Select_internal(ref Socket[] sockets, int microSeconds, out int error);
/// Determines the status of one or more sockets.
/// An of instances to check for readability.
/// An of instances to check for writability.
/// An of instances to check for errors.
/// The time-out value, in microseconds. A -1 value indicates an infinite time-out.
/// The parameter is null or empty.-and- The parameter is null or empty -and- The parameter is null or empty.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
// Token: 0x06000FA7 RID: 4007 RVA: 0x0002AEA8 File Offset: 0x000290A8
public static void Select(IList checkRead, IList checkWrite, IList checkError, int microSeconds)
{
ArrayList arrayList = new ArrayList();
Socket.AddSockets(arrayList, checkRead, "checkRead");
Socket.AddSockets(arrayList, checkWrite, "checkWrite");
Socket.AddSockets(arrayList, checkError, "checkError");
if (arrayList.Count == 3)
{
throw new ArgumentNullException("checkRead, checkWrite, checkError", "All the lists are null or empty.");
}
Socket[] array = (Socket[])arrayList.ToArray(typeof(Socket));
int num;
Socket.Select_internal(ref array, microSeconds, out num);
if (num != 0)
{
throw new SocketException(num);
}
if (array == null)
{
if (checkRead != null)
{
checkRead.Clear();
}
if (checkWrite != null)
{
checkWrite.Clear();
}
if (checkError != null)
{
checkError.Clear();
}
return;
}
int num2 = 0;
int num3 = array.Length;
IList list = checkRead;
int num4 = 0;
for (int i = 0; i < num3; i++)
{
Socket socket = array[i];
if (socket == null)
{
if (list != null)
{
int num5 = list.Count - num4;
for (int j = 0; j < num5; j++)
{
list.RemoveAt(num4);
}
}
list = ((num2 != 0) ? checkError : checkWrite);
num4 = 0;
num2++;
}
else
{
if (num2 == 1 && list == checkWrite && !socket.connected && (int)socket.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Error) == 0)
{
socket.connected = true;
}
if (list != null && num4 < list.Count)
{
while ((Socket)list[num4] != socket)
{
list.RemoveAt(num4);
}
}
num4++;
}
}
}
// Token: 0x06000FA8 RID: 4008 RVA: 0x0002B058 File Offset: 0x00029258
private void SocketDefaults()
{
try
{
if (this.address_family == AddressFamily.InterNetwork)
{
this.DontFragment = false;
}
}
catch (SocketException)
{
}
}
// Token: 0x06000FA9 RID: 4009
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int Available_internal(IntPtr socket, out int error);
/// Gets the amount of data that has been received from the network and is available to be read.
/// The number of bytes of data received from the network and available to be read.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x17000558 RID: 1368
// (get) Token: 0x06000FAA RID: 4010 RVA: 0x0002B0A0 File Offset: 0x000292A0
public int Available
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
int num2;
int num = Socket.Available_internal(this.socket, out num2);
if (num2 != 0)
{
throw new SocketException(num2);
}
return num;
}
}
/// Gets or sets a value that specifies whether the allows Internet Protocol (IP) datagrams to be fragmented.
/// true if the allows datagram fragmentation; otherwise, false. The default is true.
/// This property can be set only for sockets in the or families.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x17000559 RID: 1369
// (get) Token: 0x06000FAB RID: 4011 RVA: 0x0002B0F0 File Offset: 0x000292F0
// (set) Token: 0x06000FAC RID: 4012 RVA: 0x0002B180 File Offset: 0x00029380
public bool DontFragment
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
bool flag;
if (this.address_family == AddressFamily.InterNetwork)
{
flag = (int)this.GetSocketOption(SocketOptionLevel.IP, SocketOptionName.DontFragment) != 0;
}
else
{
if (this.address_family != AddressFamily.InterNetworkV6)
{
throw new NotSupportedException("This property is only valid for InterNetwork and InterNetworkV6 sockets");
}
flag = (int)this.GetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.DontFragment) != 0;
}
return flag;
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (this.address_family == AddressFamily.InterNetwork)
{
this.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.DontFragment, (!value) ? 0 : 1);
}
else
{
if (this.address_family != AddressFamily.InterNetworkV6)
{
throw new NotSupportedException("This property is only valid for InterNetwork and InterNetworkV6 sockets");
}
this.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.DontFragment, (!value) ? 0 : 1);
}
}
}
/// Gets or sets a value that specifies whether the can send or receive broadcast packets.
/// true if the allows broadcast packets; otherwise, false. The default is false.
/// This option is valid for a datagram socket only.
/// The has been closed.
///
///
///
///
///
// Token: 0x1700055A RID: 1370
// (get) Token: 0x06000FAD RID: 4013 RVA: 0x0002B210 File Offset: 0x00029410
// (set) Token: 0x06000FAE RID: 4014 RVA: 0x0002B274 File Offset: 0x00029474
public bool EnableBroadcast
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (this.protocol_type != ProtocolType.Udp)
{
throw new SocketException(10042);
}
return (int)this.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast) != 0;
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (this.protocol_type != ProtocolType.Udp)
{
throw new SocketException(10042);
}
this.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, (!value) ? 0 : 1);
}
}
/// Gets or sets a value that specifies whether the allows only one process to bind to a port.
/// true if the allows only one socket to bind to a specific port; otherwise, false. The default is true for Windows Server 2003 and Windows XP Service Pack 2, and false for all other versions.
/// An error occurred when attempting to access the socket.
/// The has been closed.
///
/// has been called for this .
///
///
///
///
///
// Token: 0x1700055B RID: 1371
// (get) Token: 0x06000FAF RID: 4015 RVA: 0x0002B2DC File Offset: 0x000294DC
// (set) Token: 0x06000FB0 RID: 4016 RVA: 0x0002B328 File Offset: 0x00029528
public bool ExclusiveAddressUse
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
return (int)this.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse) != 0;
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (this.isbound)
{
throw new InvalidOperationException("Bind has already been called for this socket");
}
this.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, (!value) ? 0 : 1);
}
}
/// Gets a value that indicates whether the is bound to a specific local port.
/// true if the is bound to a local port; otherwise, false.
// Token: 0x1700055C RID: 1372
// (get) Token: 0x06000FB1 RID: 4017 RVA: 0x0002B38C File Offset: 0x0002958C
public bool IsBound
{
get
{
return this.isbound;
}
}
/// Gets or sets a value that specifies whether the will delay closing a socket in an attempt to send all pending data.
/// A that specifies how to linger while closing a socket.
/// An error occurred when attempting to access the socket.
/// The has been closed.
///
///
///
///
///
// Token: 0x1700055D RID: 1373
// (get) Token: 0x06000FB2 RID: 4018 RVA: 0x0002B394 File Offset: 0x00029594
// (set) Token: 0x06000FB3 RID: 4019 RVA: 0x0002B3E0 File Offset: 0x000295E0
public LingerOption LingerState
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
return (LingerOption)this.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger);
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
this.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger, value);
}
}
/// Gets or sets a value that specifies whether outgoing multicast packets are delivered to the sending application.
/// true if the receives outgoing multicast packets; otherwise, false.
/// An error occurred when attempting to access the socket.
/// The has been closed.
///
///
///
///
///
// Token: 0x1700055E RID: 1374
// (get) Token: 0x06000FB4 RID: 4020 RVA: 0x0002B428 File Offset: 0x00029628
// (set) Token: 0x06000FB5 RID: 4021 RVA: 0x0002B4D0 File Offset: 0x000296D0
public bool MulticastLoopback
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (this.protocol_type == ProtocolType.Tcp)
{
throw new SocketException(10042);
}
bool flag;
if (this.address_family == AddressFamily.InterNetwork)
{
flag = (int)this.GetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastLoopback) != 0;
}
else
{
if (this.address_family != AddressFamily.InterNetworkV6)
{
throw new NotSupportedException("This property is only valid for InterNetwork and InterNetworkV6 sockets");
}
flag = (int)this.GetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.MulticastLoopback) != 0;
}
return flag;
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (this.protocol_type == ProtocolType.Tcp)
{
throw new SocketException(10042);
}
if (this.address_family == AddressFamily.InterNetwork)
{
this.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastLoopback, (!value) ? 0 : 1);
}
else
{
if (this.address_family != AddressFamily.InterNetworkV6)
{
throw new NotSupportedException("This property is only valid for InterNetwork and InterNetworkV6 sockets");
}
this.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.MulticastLoopback, (!value) ? 0 : 1);
}
}
}
/// Specifies whether the socket should only use Overlapped I/O mode.
/// true if the uses only overlapped I/O; otherwise, false. The default is false.
/// The socket has been bound to a completion port.
// Token: 0x1700055F RID: 1375
// (get) Token: 0x06000FB6 RID: 4022 RVA: 0x0002B578 File Offset: 0x00029778
// (set) Token: 0x06000FB7 RID: 4023 RVA: 0x0002B580 File Offset: 0x00029780
[global::System.MonoTODO("This doesn't do anything on Mono yet")]
public bool UseOnlyOverlappedIO
{
get
{
return this.useoverlappedIO;
}
set
{
this.useoverlappedIO = value;
}
}
/// Gets the operating system handle for the .
/// An that represents the operating system handle for the .
///
///
///
// Token: 0x17000560 RID: 1376
// (get) Token: 0x06000FB8 RID: 4024 RVA: 0x0002B58C File Offset: 0x0002978C
public IntPtr Handle
{
get
{
return this.socket;
}
}
// Token: 0x06000FB9 RID: 4025
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern SocketAddress LocalEndPoint_internal(IntPtr socket, out int error);
/// Gets the local endpoint.
/// The that the is using for communications.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x17000561 RID: 1377
// (get) Token: 0x06000FBA RID: 4026 RVA: 0x0002B594 File Offset: 0x00029794
public EndPoint LocalEndPoint
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (this.seed_endpoint == null)
{
return null;
}
int num;
SocketAddress socketAddress = Socket.LocalEndPoint_internal(this.socket, out num);
if (num != 0)
{
throw new SocketException(num);
}
return this.seed_endpoint.Create(socketAddress);
}
}
/// Gets the type of the .
/// One of the values.
// Token: 0x17000562 RID: 1378
// (get) Token: 0x06000FBB RID: 4027 RVA: 0x0002B5FC File Offset: 0x000297FC
public SocketType SocketType
{
get
{
return this.socket_type;
}
}
/// Gets or sets a value that specifies the amount of time after which a synchronous call will time out.
/// The time-out value, in milliseconds. If you set the property with a value between 1 and 499, the value will be changed to 500. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period.
/// An error occurred when attempting to access the socket.
/// The has been closed.
/// The value specified for a set operation is less than -1.
///
///
///
///
///
// Token: 0x17000563 RID: 1379
// (get) Token: 0x06000FBC RID: 4028 RVA: 0x0002B604 File Offset: 0x00029804
// (set) Token: 0x06000FBD RID: 4029 RVA: 0x0002B650 File Offset: 0x00029850
public int SendTimeout
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
return (int)this.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout);
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (value < -1)
{
throw new ArgumentOutOfRangeException("value", "The value specified for a set operation is less than -1");
}
if (value == -1)
{
value = 0;
}
this.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, value);
}
}
/// Gets or sets a value that specifies the amount of time after which a synchronous call will time out.
/// The time-out value, in milliseconds. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period.
/// An error occurred when attempting to access the socket.
/// The has been closed.
/// The value specified for a set operation is less than -1.
///
///
///
///
///
// Token: 0x17000564 RID: 1380
// (get) Token: 0x06000FBE RID: 4030 RVA: 0x0002B6B8 File Offset: 0x000298B8
// (set) Token: 0x06000FBF RID: 4031 RVA: 0x0002B704 File Offset: 0x00029904
public int ReceiveTimeout
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
return (int)this.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout);
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (value < -1)
{
throw new ArgumentOutOfRangeException("value", "The value specified for a set operation is less than -1");
}
if (value == -1)
{
value = 0;
}
this.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, value);
}
}
/// Begins an asynchronous operation to accept an incoming connection attempt.
/// Returns true if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation.Returns false if the I/O operation completed synchronously. The event on the parameter will not be raised and the object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.
/// The object to use for this asynchronous socket operation.
/// An argument is not valid. This exception occurs if the buffer provided is not large enough. The buffer must be at least 2 * (sizeof(SOCKADDR_STORAGE + 16) bytes. This exception also occurs if multiple buffers are specified, the property is not null.
/// An argument is out of range. The exception occurs if the is less than 0.
/// An invalid operation was requested. This exception occurs if the accepting is not listening for connections or the accepted socket is bound. You must call the and method before calling the method.This exception also occurs if the socket is already connected or a socket operation was already in progress using the specified parameter.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// Windows XP or later is required for this method.
/// The has been closed.
// Token: 0x06000FC0 RID: 4032 RVA: 0x0002B76C File Offset: 0x0002996C
public bool AcceptAsync(SocketAsyncEventArgs e)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (!this.IsBound)
{
throw new InvalidOperationException("You must call the Bind method before performing this operation.");
}
if (!this.islistening)
{
throw new InvalidOperationException("You must call the Listen method before performing this operation.");
}
if (e.BufferList != null)
{
throw new ArgumentException("Multiple buffers cannot be used with this method.");
}
if (e.Count < 0)
{
throw new ArgumentOutOfRangeException("e.Count");
}
Socket acceptSocket = e.AcceptSocket;
if (acceptSocket != null)
{
if (acceptSocket.IsBound || acceptSocket.Connected)
{
throw new InvalidOperationException("AcceptSocket: The socket must not be bound or connected.");
}
}
else
{
e.AcceptSocket = new Socket(this.AddressFamily, this.SocketType, this.ProtocolType);
}
try
{
e.DoOperation(SocketAsyncOperation.Accept, this);
}
catch
{
((IDisposable)e).Dispose();
throw;
}
return true;
}
// Token: 0x06000FC1 RID: 4033
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr Accept_internal(IntPtr sock, out int error, bool blocking);
/// Creates a new for a newly created connection.
/// A for a newly created connection.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// The accepting socket is not listening for connections. You must call and before calling .
///
///
///
///
///
///
// Token: 0x06000FC2 RID: 4034 RVA: 0x0002B884 File Offset: 0x00029A84
public Socket Accept()
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
int num = 0;
IntPtr intPtr = (IntPtr)(-1);
this.blocking_thread = Thread.CurrentThread;
try
{
intPtr = Socket.Accept_internal(this.socket, out num, this.blocking);
}
catch (ThreadAbortException)
{
if (this.disposed)
{
Thread.ResetAbort();
num = 10004;
}
}
finally
{
this.blocking_thread = null;
}
if (num != 0)
{
throw new SocketException(num);
}
return new Socket(this.AddressFamily, this.SocketType, this.ProtocolType, intPtr)
{
seed_endpoint = this.seed_endpoint,
Blocking = this.Blocking
};
}
// Token: 0x06000FC3 RID: 4035 RVA: 0x0002B97C File Offset: 0x00029B7C
internal void Accept(Socket acceptSocket)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
int num = 0;
IntPtr intPtr = (IntPtr)(-1);
this.blocking_thread = Thread.CurrentThread;
try
{
intPtr = Socket.Accept_internal(this.socket, out num, this.blocking);
}
catch (ThreadAbortException)
{
if (this.disposed)
{
Thread.ResetAbort();
num = 10004;
}
}
finally
{
this.blocking_thread = null;
}
if (num != 0)
{
throw new SocketException(num);
}
acceptSocket.address_family = this.AddressFamily;
acceptSocket.socket_type = this.SocketType;
acceptSocket.protocol_type = this.ProtocolType;
acceptSocket.socket = intPtr;
acceptSocket.connected = true;
acceptSocket.seed_endpoint = this.seed_endpoint;
acceptSocket.Blocking = this.Blocking;
}
/// Begins an asynchronous operation to accept an incoming connection attempt.
/// An that references the asynchronous creation.
/// The delegate.
/// An object that contains state information for this request.
/// The object has been closed.
/// Windows NT is required for this method.
/// The accepting socket is not listening for connections. You must call and before calling .-or- The accepted socket is bound.
///
/// is less than 0.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
///
///
///
///
// Token: 0x06000FC4 RID: 4036 RVA: 0x0002BA8C File Offset: 0x00029C8C
public IAsyncResult BeginAccept(AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (!this.isbound || !this.islistening)
{
throw new InvalidOperationException();
}
Socket.SocketAsyncResult socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.Accept);
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.Accept);
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
return socketAsyncResult;
}
/// Begins an asynchronous operation to accept an incoming connection attempt and receives the first block of data sent by the client application.
/// An that references the asynchronous creation.
/// The number of bytes to accept from the sender.
/// The delegate.
/// An object that contains state information for this request.
/// The object has been closed.
/// Windows NT is required for this method.
/// The accepting socket is not listening for connections. You must call and before calling .-or- The accepted socket is bound.
///
/// is less than 0.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
///
///
///
///
// Token: 0x06000FC5 RID: 4037 RVA: 0x0002BB04 File Offset: 0x00029D04
public IAsyncResult BeginAccept(int receiveSize, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (receiveSize < 0)
{
throw new ArgumentOutOfRangeException("receiveSize", "receiveSize is less than zero");
}
Socket.SocketAsyncResult socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.AcceptReceive);
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.AcceptReceive);
socketAsyncResult.Buffer = new byte[receiveSize];
socketAsyncResult.Offset = 0;
socketAsyncResult.Size = receiveSize;
socketAsyncResult.SockFlags = SocketFlags.None;
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
return socketAsyncResult;
}
/// Begins an asynchronous operation to accept an incoming connection attempt from a specified socket and receives the first block of data sent by the client application.
/// An object that references the asynchronous object creation.
/// The accepted object. This value may be null.
/// The maximum number of bytes to receive.
/// The delegate.
/// An object that contains state information for this request.
/// The object has been closed.
/// Windows NT is required for this method.
/// The accepting socket is not listening for connections. You must call and before calling .-or- The accepted socket is bound.
///
/// is less than 0.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
///
///
///
///
// Token: 0x06000FC6 RID: 4038 RVA: 0x0002BB9C File Offset: 0x00029D9C
public IAsyncResult BeginAccept(Socket acceptSocket, int receiveSize, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (receiveSize < 0)
{
throw new ArgumentOutOfRangeException("receiveSize", "receiveSize is less than zero");
}
if (acceptSocket != null)
{
if (acceptSocket.disposed && acceptSocket.closed)
{
throw new ObjectDisposedException(acceptSocket.GetType().ToString());
}
if (acceptSocket.IsBound)
{
throw new InvalidOperationException();
}
if (acceptSocket.ProtocolType != ProtocolType.Tcp)
{
throw new SocketException(10022);
}
}
Socket.SocketAsyncResult socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.AcceptReceive);
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.AcceptReceive);
socketAsyncResult.Buffer = new byte[receiveSize];
socketAsyncResult.Offset = 0;
socketAsyncResult.Size = receiveSize;
socketAsyncResult.SockFlags = SocketFlags.None;
socketAsyncResult.AcceptSocket = acceptSocket;
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
return socketAsyncResult;
}
/// Begins an asynchronous request for a remote host connection.
/// An that references the asynchronous connection.
/// An that represents the remote host.
/// The delegate.
/// An object that contains state information for this request.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// A caller higher in the call stack does not have permission for the requested operation.
/// The is ing.
///
///
///
///
///
///
///
// Token: 0x06000FC7 RID: 4039 RVA: 0x0002BC90 File Offset: 0x00029E90
public IAsyncResult BeginConnect(EndPoint end_point, AsyncCallback callback, object state)
{
return this.BeginConnect(end_point, callback, state, false);
}
// Token: 0x06000FC8 RID: 4040 RVA: 0x0002BC9C File Offset: 0x00029E9C
internal IAsyncResult BeginConnect(EndPoint end_point, AsyncCallback callback, object state, bool bypassSocketSecurity)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (end_point == null)
{
throw new ArgumentNullException("end_point");
}
Socket.SocketAsyncResult socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.Connect);
socketAsyncResult.EndPoint = end_point;
if (end_point is IPEndPoint)
{
IPEndPoint ipendPoint = (IPEndPoint)end_point;
if (ipendPoint.Address.Equals(IPAddress.Any) || ipendPoint.Address.Equals(IPAddress.IPv6Any))
{
socketAsyncResult.Complete(new SocketException(10049), true);
return socketAsyncResult;
}
}
int num = 0;
if (!this.blocking)
{
SocketAddress socketAddress = end_point.Serialize();
Socket.Connect_internal(this.socket, socketAddress, out num);
if (num == 0)
{
this.connected = true;
socketAsyncResult.Complete(true);
}
else if (num != 10036 && num != 10035)
{
this.connected = false;
socketAsyncResult.Complete(new SocketException(num), true);
}
}
if (this.blocking || num == 10036 || num == 10035)
{
this.connected = false;
Socket.Worker worker = new Socket.Worker(socketAsyncResult, bypassSocketSecurity);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.Connect);
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
}
return socketAsyncResult;
}
/// Begins an asynchronous request for a remote host connection. The host is specified by an and a port number.
/// An that references the asynchronous connection.
/// The of the remote host.
/// The port number of the remote host.
/// An delegate that references the method to invoke when the connect operation is complete.
/// A user-defined object that contains information about the connect operation. This object is passed to the delegate when the operation is complete.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// The is not in the socket family.
/// The port number is not valid.
/// The length of is zero.
/// The is ing.
///
///
///
///
///
///
///
// Token: 0x06000FC9 RID: 4041 RVA: 0x0002BDF4 File Offset: 0x00029FF4
public IAsyncResult BeginConnect(IPAddress address, int port, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (address == null)
{
throw new ArgumentNullException("address");
}
if (address.ToString().Length == 0)
{
throw new ArgumentException("The length of the IP address is zero");
}
if (this.islistening)
{
throw new InvalidOperationException();
}
IPEndPoint ipendPoint = new IPEndPoint(address, port);
return this.BeginConnect(ipendPoint, callback, state);
}
/// Begins an asynchronous request for a remote host connection. The host is specified by an array and a port number.
/// An that references the asynchronous connections.
/// At least one , designating the remote host.
/// The port number of the remote host.
/// An delegate that references the method to invoke when the connect operation is complete.
/// A user-defined object that contains information about the connect operation. This object is passed to the delegate when the operation is complete.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// This method is valid for sockets that use or .
/// The port number is not valid.
/// The length of is zero.
/// The is ing.
///
///
///
///
///
///
///
// Token: 0x06000FCA RID: 4042 RVA: 0x0002BE78 File Offset: 0x0002A078
public IAsyncResult BeginConnect(IPAddress[] addresses, int port, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (addresses == null)
{
throw new ArgumentNullException("addresses");
}
if (this.AddressFamily != AddressFamily.InterNetwork && this.AddressFamily != AddressFamily.InterNetworkV6)
{
throw new NotSupportedException("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
}
if (this.islistening)
{
throw new InvalidOperationException();
}
Socket.SocketAsyncResult socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.Connect);
socketAsyncResult.Addresses = addresses;
socketAsyncResult.Port = port;
this.connected = false;
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.Connect);
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
return socketAsyncResult;
}
/// Begins an asynchronous request for a remote host connection. The host is specified by a host name and a port number.
/// An that references the asynchronous connection.
/// The name of the remote host.
/// The port number of the remote host.
/// An delegate that references the method to invoke when the connect operation is complete.
/// A user-defined object that contains information about the connect operation. This object is passed to the delegate when the operation is complete.
///
/// is null.
/// The has been closed.
/// This method is valid for sockets in the or families.
/// The port number is not valid.
/// The is ing.
///
///
///
///
///
///
///
// Token: 0x06000FCB RID: 4043 RVA: 0x0002BF30 File Offset: 0x0002A130
public IAsyncResult BeginConnect(string host, int port, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (host == null)
{
throw new ArgumentNullException("host");
}
if (this.address_family != AddressFamily.InterNetwork && this.address_family != AddressFamily.InterNetworkV6)
{
throw new NotSupportedException("This method is valid only for sockets in the InterNetwork and InterNetworkV6 families");
}
if (this.islistening)
{
throw new InvalidOperationException();
}
IPAddress[] hostAddresses = Dns.GetHostAddresses(host);
return this.BeginConnect(hostAddresses, port, callback, state);
}
/// Begins an asynchronous request to disconnect from a remote endpoint.
/// An object that references the asynchronous operation.
/// true if this socket can be reused after the connection is closed; otherwise, false.
/// The delegate.
/// An object that contains state information for this request.
/// The operating system is Windows 2000 or earlier, and this method requires Windows XP.
/// The object has been closed.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
///
///
///
// Token: 0x06000FCC RID: 4044 RVA: 0x0002BFBC File Offset: 0x0002A1BC
public IAsyncResult BeginDisconnect(bool reuseSocket, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
Socket.SocketAsyncResult socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.Disconnect);
socketAsyncResult.ReuseSocket = reuseSocket;
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.Disconnect);
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
return socketAsyncResult;
}
/// Begins to asynchronously receive data from a connected .
/// An that references the asynchronous read.
/// An array of type that is the storage location for the received data.
/// The zero-based position in the parameter at which to store the received data.
/// The number of bytes to receive.
/// A bitwise combination of the values.
/// An delegate that references the method to invoke when the operation is complete.
/// A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
/// has been closed.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
///
///
///
///
///
// Token: 0x06000FCD RID: 4045 RVA: 0x0002C020 File Offset: 0x0002A220
public IAsyncResult BeginReceive(byte[] buffer, int offset, int size, SocketFlags socket_flags, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0 || offset > buffer.Length)
{
throw new ArgumentOutOfRangeException("offset");
}
if (size < 0 || offset + size > buffer.Length)
{
throw new ArgumentOutOfRangeException("size");
}
Queue queue = this.readQ;
Socket.SocketAsyncResult socketAsyncResult;
lock (queue)
{
socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.Receive);
socketAsyncResult.Buffer = buffer;
socketAsyncResult.Offset = offset;
socketAsyncResult.Size = size;
socketAsyncResult.SockFlags = socket_flags;
this.readQ.Enqueue(socketAsyncResult);
if (this.readQ.Count == 1)
{
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.Receive);
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
}
}
return socketAsyncResult;
}
/// Begins to asynchronously receive data from a connected .
/// An that references the asynchronous read.
/// An array of type that is the storage location for the received data.
/// The location in to store the received data.
/// The number of bytes to receive.
/// A bitwise combination of the values.
/// A object that stores the socket error.
/// An delegate that references the method to invoke when the operation is complete.
/// A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
/// has been closed.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
// Token: 0x06000FCE RID: 4046 RVA: 0x0002C138 File Offset: 0x0002A338
public IAsyncResult BeginReceive(byte[] buffer, int offset, int size, SocketFlags flags, out SocketError error, AsyncCallback callback, object state)
{
error = SocketError.Success;
return this.BeginReceive(buffer, offset, size, flags, callback, state);
}
/// Begins to asynchronously receive data from a connected .
/// An that references the asynchronous read.
/// An array of type that is the storage location for the received data.
/// A bitwise combination of the values.
/// An delegate that references the method to invoke when the operation is complete.
/// A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
/// has been closed.
// Token: 0x06000FCF RID: 4047 RVA: 0x0002C150 File Offset: 0x0002A350
[CLSCompliant(false)]
public IAsyncResult BeginReceive(IList> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffers == null)
{
throw new ArgumentNullException("buffers");
}
Queue queue = this.readQ;
Socket.SocketAsyncResult socketAsyncResult;
lock (queue)
{
socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.ReceiveGeneric);
socketAsyncResult.Buffers = buffers;
socketAsyncResult.SockFlags = socketFlags;
this.readQ.Enqueue(socketAsyncResult);
if (this.readQ.Count == 1)
{
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.ReceiveGeneric);
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
}
}
return socketAsyncResult;
}
/// Begins to asynchronously receive data from a connected .
/// An that references the asynchronous read.
/// An array of type that is the storage location for the received data.
/// A bitwise combination of the values.
/// A object that stores the socket error.
/// An delegate that references the method to invoke when the operation is complete.
/// A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
/// has been closed.
// Token: 0x06000FD0 RID: 4048 RVA: 0x0002C220 File Offset: 0x0002A420
[CLSCompliant(false)]
public IAsyncResult BeginReceive(IList> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
errorCode = SocketError.Success;
return this.BeginReceive(buffers, socketFlags, callback, state);
}
/// Begins to asynchronously receive data from a specified network device.
/// An that references the asynchronous read.
/// An array of type that is the storage location for the received data.
/// The zero-based position in the parameter at which to store the data.
/// The number of bytes to receive.
/// A bitwise combination of the values.
/// An that represents the source of the data.
/// The delegate.
/// An object that contains state information for this request.
///
/// is null.-or- is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
/// The has been closed.
/// A caller higher in the call stack does not have permission for the requested operation.
///
///
///
///
///
///
// Token: 0x06000FD1 RID: 4049 RVA: 0x0002C234 File Offset: 0x0002A434
public IAsyncResult BeginReceiveFrom(byte[] buffer, int offset, int size, SocketFlags socket_flags, ref EndPoint remote_end, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset", "offset must be >= 0");
}
if (size < 0)
{
throw new ArgumentOutOfRangeException("size", "size must be >= 0");
}
if (offset + size > buffer.Length)
{
throw new ArgumentOutOfRangeException("offset, size", "offset + size exceeds the buffer length");
}
Queue queue = this.readQ;
Socket.SocketAsyncResult socketAsyncResult;
lock (queue)
{
socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.ReceiveFrom);
socketAsyncResult.Buffer = buffer;
socketAsyncResult.Offset = offset;
socketAsyncResult.Size = size;
socketAsyncResult.SockFlags = socket_flags;
socketAsyncResult.EndPoint = remote_end;
this.readQ.Enqueue(socketAsyncResult);
if (this.readQ.Count == 1)
{
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.ReceiveFrom);
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
}
}
return socketAsyncResult;
}
/// Begins to asynchronously receive the specified number of bytes of data into the specified location of the data buffer, using the specified , and stores the endpoint and packet information..
/// An that references the asynchronous read.
/// An array of type that is the storage location for the received data.
/// The zero-based position in the parameter at which to store the data.
/// The number of bytes to receive.
/// A bitwise combination of the values.
/// An that represents the source of the data.
/// The delegate.
/// An object that contains state information for this request.
///
/// is null.-or- is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
/// The has been closed.
/// The operating system is Windows 2000 or earlier, and this method requires Windows XP.
// Token: 0x06000FD2 RID: 4050 RVA: 0x0002C364 File Offset: 0x0002A564
[global::System.MonoTODO]
public IAsyncResult BeginReceiveMessageFrom(byte[] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (remoteEP == null)
{
throw new ArgumentNullException("remoteEP");
}
if (offset < 0 || offset > buffer.Length)
{
throw new ArgumentOutOfRangeException("offset");
}
if (size < 0 || offset + size > buffer.Length)
{
throw new ArgumentOutOfRangeException("size");
}
throw new NotImplementedException();
}
/// Sends data asynchronously to a connected .
/// An that references the asynchronous send.
/// An array of type that contains the data to send.
/// The zero-based position in the parameter at which to begin sending data.
/// The number of bytes to send.
/// A bitwise combination of the values.
/// The delegate.
/// An object that contains state information for this request.
///
/// is null.
/// An error occurred when attempting to access the socket. See remarks section below.
///
/// is less than 0.-or- is less than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
/// The has been closed.
///
///
///
///
///
// Token: 0x06000FD3 RID: 4051 RVA: 0x0002C3FC File Offset: 0x0002A5FC
public IAsyncResult BeginSend(byte[] buffer, int offset, int size, SocketFlags socket_flags, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset", "offset must be >= 0");
}
if (size < 0)
{
throw new ArgumentOutOfRangeException("size", "size must be >= 0");
}
if (offset + size > buffer.Length)
{
throw new ArgumentOutOfRangeException("offset, size", "offset + size exceeds the buffer length");
}
if (!this.connected)
{
throw new SocketException(10057);
}
Queue queue = this.writeQ;
Socket.SocketAsyncResult socketAsyncResult;
lock (queue)
{
socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.Send);
socketAsyncResult.Buffer = buffer;
socketAsyncResult.Offset = offset;
socketAsyncResult.Size = size;
socketAsyncResult.SockFlags = socket_flags;
this.writeQ.Enqueue(socketAsyncResult);
if (this.writeQ.Count == 1)
{
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.Send);
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
}
}
return socketAsyncResult;
}
/// Sends data asynchronously to a connected .
/// An that references the asynchronous send.
/// An array of type that contains the data to send.
/// The zero-based position in the parameter at which to begin sending data.
/// The number of bytes to send.
/// A bitwise combination of the values.
/// A object that stores the socket error.
/// The delegate.
/// An object that contains state information for this request.
///
/// is null.
/// An error occurred when attempting to access the socket. See remarks section below.
///
/// is less than 0.-or- is less than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
/// The has been closed.
// Token: 0x06000FD4 RID: 4052 RVA: 0x0002C53C File Offset: 0x0002A73C
public IAsyncResult BeginSend(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
if (!this.connected)
{
errorCode = SocketError.NotConnected;
throw new SocketException((int)errorCode);
}
errorCode = SocketError.Success;
return this.BeginSend(buffer, offset, size, socketFlags, callback, state);
}
/// Sends data asynchronously to a connected .
/// An that references the asynchronous send.
/// An array of type that contains the data to send.
/// A bitwise combination of the values.
/// The delegate.
/// An object that contains state information for this request.
///
/// is null.
///
/// is empty.
/// An error occurred when attempting to access the socket. See remarks section below.
/// The has been closed.
// Token: 0x06000FD5 RID: 4053 RVA: 0x0002C570 File Offset: 0x0002A770
public IAsyncResult BeginSend(IList> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffers == null)
{
throw new ArgumentNullException("buffers");
}
if (!this.connected)
{
throw new SocketException(10057);
}
Queue queue = this.writeQ;
Socket.SocketAsyncResult socketAsyncResult;
lock (queue)
{
socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.SendGeneric);
socketAsyncResult.Buffers = buffers;
socketAsyncResult.SockFlags = socketFlags;
this.writeQ.Enqueue(socketAsyncResult);
if (this.writeQ.Count == 1)
{
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.SendGeneric);
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
}
}
return socketAsyncResult;
}
/// Sends data asynchronously to a connected .
/// An that references the asynchronous send.
/// An array of type that contains the data to send.
/// A bitwise combination of the values.
/// A object that stores the socket error.
/// The delegate.
/// An object that contains state information for this request.
///
/// is null.
///
/// is empty.
/// An error occurred when attempting to access the socket. See remarks section below.
/// The has been closed.
// Token: 0x06000FD6 RID: 4054 RVA: 0x0002C658 File Offset: 0x0002A858
[CLSCompliant(false)]
public IAsyncResult BeginSend(IList> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
if (!this.connected)
{
errorCode = SocketError.NotConnected;
throw new SocketException((int)errorCode);
}
errorCode = SocketError.Success;
return this.BeginSend(buffers, socketFlags, callback, state);
}
/// Sends the file to a connected object using the flag.
/// An object that represents the asynchronous send.
/// A string that contains the path and name of the file to send. This parameter can be null.
/// The delegate.
/// An object that contains state information for this request.
/// The object has been closed.
/// The socket is not connected to a remote host.
/// The file was not found.
/// An error occurred when attempting to access the socket. See remarks section below.
///
///
///
///
// Token: 0x06000FD7 RID: 4055 RVA: 0x0002C684 File Offset: 0x0002A884
public IAsyncResult BeginSendFile(string fileName, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (!this.connected)
{
throw new NotSupportedException();
}
if (!File.Exists(fileName))
{
throw new FileNotFoundException();
}
return this.BeginSendFile(fileName, null, null, TransmitFileOptions.UseDefaultWorkerThread, callback, state);
}
/// Sends a file and buffers of data asynchronously to a connected object.
/// An object that represents the asynchronous operation.
/// A string that contains the path and name of the file to be sent. This parameter can be null.
/// A array that contains data to be sent before the file is sent. This parameter can be null.
/// A array that contains data to be sent after the file is sent. This parameter can be null.
/// A bitwise combination of values.
/// An delegate to be invoked when this operation completes. This parameter can be null.
/// A user-defined object that contains state information for this request. This parameter can be null.
/// The object has been closed.
/// An error occurred when attempting to access the socket. See remarks section below.
/// The operating system is not Windows NT or later.- or - The socket is not connected to a remote host.
/// The file was not found.
// Token: 0x06000FD8 RID: 4056 RVA: 0x0002C6E8 File Offset: 0x0002A8E8
public IAsyncResult BeginSendFile(string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (!this.connected)
{
throw new NotSupportedException();
}
if (!File.Exists(fileName))
{
throw new FileNotFoundException();
}
Socket.SendFileHandler sendFileHandler = new Socket.SendFileHandler(this.SendFile);
return new Socket.SendFileAsyncResult(sendFileHandler, sendFileHandler.BeginInvoke(fileName, preBuffer, postBuffer, flags, callback, state));
}
/// Sends data asynchronously to a specific remote host.
/// An that references the asynchronous send.
/// An array of type that contains the data to send.
/// The zero-based position in at which to begin sending data.
/// The number of bytes to send.
/// A bitwise combination of the values.
/// An that represents the remote device.
/// The delegate.
/// An object that contains state information for this request.
///
/// is null.-or- is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
/// The has been closed.
/// A caller higher in the call stack does not have permission for the requested operation.
///
///
///
///
///
///
// Token: 0x06000FD9 RID: 4057 RVA: 0x0002C760 File Offset: 0x0002A960
public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size, SocketFlags socket_flags, EndPoint remote_end, AsyncCallback callback, object state)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset", "offset must be >= 0");
}
if (size < 0)
{
throw new ArgumentOutOfRangeException("size", "size must be >= 0");
}
if (offset + size > buffer.Length)
{
throw new ArgumentOutOfRangeException("offset, size", "offset + size exceeds the buffer length");
}
Queue queue = this.writeQ;
Socket.SocketAsyncResult socketAsyncResult;
lock (queue)
{
socketAsyncResult = new Socket.SocketAsyncResult(this, state, callback, Socket.SocketOperation.SendTo);
socketAsyncResult.Buffer = buffer;
socketAsyncResult.Offset = offset;
socketAsyncResult.Size = size;
socketAsyncResult.SockFlags = socket_flags;
socketAsyncResult.EndPoint = remote_end;
this.writeQ.Enqueue(socketAsyncResult);
if (this.writeQ.Count == 1)
{
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(worker.SendTo);
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
}
}
return socketAsyncResult;
}
// Token: 0x06000FDA RID: 4058
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Bind_internal(IntPtr sock, SocketAddress sa, out int error);
/// Associates a with a local endpoint.
/// The local to associate with the .
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// A caller higher in the call stack does not have permission for the requested operation.
///
///
///
///
///
///
// Token: 0x06000FDB RID: 4059 RVA: 0x0002C890 File Offset: 0x0002AA90
public void Bind(EndPoint local_end)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (local_end == null)
{
throw new ArgumentNullException("local_end");
}
if (Environment.SocketSecurityEnabled && Socket.current_bind_count >= this.max_bind_count)
{
throw new SecurityException("Too many sockets are bound, maximum count in the webplayer is " + this.max_bind_count);
}
int num;
Socket.Bind_internal(this.socket, local_end.Serialize(), out num);
if (num != 0)
{
throw new SocketException(num);
}
if (num == 0)
{
this.isbound = true;
}
if (Environment.SocketSecurityEnabled)
{
Socket.current_bind_count++;
}
this.seed_endpoint = local_end;
}
/// Begins an asynchronous request for a remote host connection.
/// Returns true if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the parameter will not be raised and the object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.
/// The object to use for this asynchronous socket operation.
/// An argument is not valid. This exception occurs if multiple buffers are specified, the property is not null.
/// The parameter cannot be null and the cannot be null.
/// The is listening or a socket operation was already in progress using the object specified in the parameter.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// Windows XP or later is required for this method. This exception also occurs if the local endpoint and the are not the same address family.
/// The has been closed.
/// A caller higher in the call stack does not have permission for the requested operation.
// Token: 0x06000FDC RID: 4060 RVA: 0x0002C954 File Offset: 0x0002AB54
public bool ConnectAsync(SocketAsyncEventArgs e)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (this.islistening)
{
throw new InvalidOperationException("You may not perform this operation after calling the Listen method.");
}
if (e.RemoteEndPoint == null)
{
throw new ArgumentNullException("remoteEP", "Value cannot be null.");
}
if (e.BufferList != null)
{
throw new ArgumentException("Multiple buffers cannot be used with this method.");
}
e.DoOperation(SocketAsyncOperation.Connect, this);
return true;
}
/// Establishes a connection to a remote host. The host is specified by an IP address and a port number.
/// The IP address of the remote host.
/// The port number of the remote host.
///
/// is null.
/// The port number is not valid.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// This method is valid for sockets in the or families.
/// The length of is zero.
/// The is ing.
///
///
///
///
///
///
///
// Token: 0x06000FDD RID: 4061 RVA: 0x0002C9D8 File Offset: 0x0002ABD8
public void Connect(IPAddress address, int port)
{
this.Connect(new IPEndPoint(address, port));
}
/// Establishes a connection to a remote host. The host is specified by an array of IP addresses and a port number.
/// The IP addresses of the remote host.
/// The port number of the remote host.
///
/// is null.
/// The port number is not valid.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// This method is valid for sockets in the or families.
/// The length of is zero.
/// The is ing.
///
///
///
///
///
///
///
// Token: 0x06000FDE RID: 4062 RVA: 0x0002C9E8 File Offset: 0x0002ABE8
public void Connect(IPAddress[] addresses, int port)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (addresses == null)
{
throw new ArgumentNullException("addresses");
}
if (this.AddressFamily != AddressFamily.InterNetwork && this.AddressFamily != AddressFamily.InterNetworkV6)
{
throw new NotSupportedException("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
}
if (this.islistening)
{
throw new InvalidOperationException();
}
int num = 0;
foreach (IPAddress ipaddress in addresses)
{
IPEndPoint ipendPoint = new IPEndPoint(ipaddress, port);
SocketAddress socketAddress = ipendPoint.Serialize();
Socket.Connect_internal(this.socket, socketAddress, out num);
if (num == 0)
{
this.connected = true;
this.seed_endpoint = ipendPoint;
return;
}
if (num == 10036 || num == 10035)
{
if (!this.blocking)
{
this.Poll(-1, SelectMode.SelectWrite);
num = (int)this.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Error);
if (num == 0)
{
this.connected = true;
this.seed_endpoint = ipendPoint;
return;
}
}
}
}
if (num != 0)
{
throw new SocketException(num);
}
}
/// Establishes a connection to a remote host. The host is specified by a host name and a port number.
/// The name of the remote host.
/// The port number of the remote host.
///
/// is null.
/// The port number is not valid.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// This method is valid for sockets in the or families.
/// The is ing.
///
///
///
///
///
///
///
// Token: 0x06000FDF RID: 4063 RVA: 0x0002CB20 File Offset: 0x0002AD20
public void Connect(string host, int port)
{
IPAddress[] hostAddresses = Dns.GetHostAddresses(host);
this.Connect(hostAddresses, port);
}
/// Begins an asynchronous request to disconnect from a remote endpoint.
/// Returns true if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the parameter will not be raised and the object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.
/// The object to use for this asynchronous socket operation.
/// The parameter cannot be null.
/// A socket operation was already in progress using the object specified in the parameter.
/// Windows XP or later is required for this method.
/// The has been closed.
/// An error occurred when attempting to access the socket.
// Token: 0x06000FE0 RID: 4064 RVA: 0x0002CB3C File Offset: 0x0002AD3C
public bool DisconnectAsync(SocketAsyncEventArgs e)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
e.DoOperation(SocketAsyncOperation.Disconnect, this);
return true;
}
// Token: 0x06000FE1 RID: 4065
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Disconnect_internal(IntPtr sock, bool reuse, out int error);
/// Closes the socket connection and allows reuse of the socket.
/// true if this socket can be reused after the current connection is closed; otherwise, false.
/// This method requires Windows 2000 or earlier, or the exception will be thrown.
/// The object has been closed.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
///
///
///
// Token: 0x06000FE2 RID: 4066 RVA: 0x0002CB7C File Offset: 0x0002AD7C
public void Disconnect(bool reuseSocket)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
int num = 0;
Socket.Disconnect_internal(this.socket, reuseSocket, out num);
if (num == 0)
{
this.connected = false;
if (reuseSocket)
{
}
return;
}
if (num == 50)
{
throw new PlatformNotSupportedException();
}
throw new SocketException(num);
}
/// Duplicates the socket reference for the target process, and closes the socket for this process.
/// The socket reference to be passed to the target process.
/// The ID of the target process where a duplicate of the socket reference is created.
///
/// is not a valid process id.-or- Duplication of the socket reference failed.
// Token: 0x06000FE3 RID: 4067 RVA: 0x0002CBE8 File Offset: 0x0002ADE8
[global::System.MonoTODO("Not implemented")]
public SocketInformation DuplicateAndClose(int targetProcessId)
{
throw new NotImplementedException();
}
/// Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication.
/// A to handle communication with the remote host.
/// An that stores state information for this asynchronous operation as well as any user defined data.
///
/// is null.
///
/// was not created by a call to .
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
/// method was previously called.
/// Windows NT is required for this method.
///
///
///
///
///
///
// Token: 0x06000FE4 RID: 4068 RVA: 0x0002CBF0 File Offset: 0x0002ADF0
public Socket EndAccept(IAsyncResult result)
{
byte[] array;
int num;
return this.EndAccept(out array, out num, result);
}
/// Asynchronously accepts an incoming connection attempt and creates a new object to handle remote host communication. This method returns a buffer that contains the initial data transferred.
/// A object to handle communication with the remote host.
/// An array of type that contains the bytes transferred.
/// An object that stores state information for this asynchronous operation as well as any user defined data.
/// Windows NT is required for this method.
/// The object has been closed.
///
/// is empty.
///
/// was not created by a call to .
///
/// method was previously called.
/// An error occurred when attempting to access the See the Remarks section for more information.
///
///
///
///
///
///
// Token: 0x06000FE5 RID: 4069 RVA: 0x0002CC08 File Offset: 0x0002AE08
public Socket EndAccept(out byte[] buffer, IAsyncResult asyncResult)
{
int num;
return this.EndAccept(out buffer, out num, asyncResult);
}
/// Asynchronously accepts an incoming connection attempt and creates a new object to handle remote host communication. This method returns a buffer that contains the initial data and the number of bytes transferred.
/// A object to handle communication with the remote host.
/// An array of type that contains the bytes transferred.
/// The number of bytes transferred.
/// An object that stores state information for this asynchronous operation as well as any user defined data.
/// Windows NT is required for this method.
/// The object has been closed.
///
/// is empty.
///
/// was not created by a call to .
///
/// method was previously called.
/// An error occurred when attempting to access the . See the Remarks section for more information.
///
///
///
///
///
///
// Token: 0x06000FE6 RID: 4070 RVA: 0x0002CC20 File Offset: 0x0002AE20
public Socket EndAccept(out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (asyncResult == null)
{
throw new ArgumentNullException("asyncResult");
}
Socket.SocketAsyncResult socketAsyncResult = asyncResult as Socket.SocketAsyncResult;
if (socketAsyncResult == null)
{
throw new ArgumentException("Invalid IAsyncResult", "asyncResult");
}
if (Interlocked.CompareExchange(ref socketAsyncResult.EndCalled, 1, 0) == 1)
{
throw this.InvalidAsyncOp("EndAccept");
}
if (!asyncResult.IsCompleted)
{
asyncResult.AsyncWaitHandle.WaitOne();
}
socketAsyncResult.CheckIfThrowDelayedException();
buffer = socketAsyncResult.Buffer;
bytesTransferred = socketAsyncResult.Total;
return socketAsyncResult.Socket;
}
/// Ends a pending asynchronous connection request.
/// An that stores state information and any user defined data for this asynchronous operation.
///
/// is null.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous connection.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x06000FE7 RID: 4071 RVA: 0x0002CCD4 File Offset: 0x0002AED4
public void EndConnect(IAsyncResult result)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (result == null)
{
throw new ArgumentNullException("result");
}
Socket.SocketAsyncResult socketAsyncResult = result as Socket.SocketAsyncResult;
if (socketAsyncResult == null)
{
throw new ArgumentException("Invalid IAsyncResult", "result");
}
if (Interlocked.CompareExchange(ref socketAsyncResult.EndCalled, 1, 0) == 1)
{
throw this.InvalidAsyncOp("EndConnect");
}
if (!result.IsCompleted)
{
result.AsyncWaitHandle.WaitOne();
}
socketAsyncResult.CheckIfThrowDelayedException();
}
/// Ends a pending asynchronous disconnect request.
/// An object that stores state information and any user-defined data for this asynchronous operation.
/// The operating system is Windows 2000 or earlier, and this method requires Windows XP.
/// The object has been closed.
///
/// is null.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous connection.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The disconnect request has timed out.
///
///
///
///
///
// Token: 0x06000FE8 RID: 4072 RVA: 0x0002CD74 File Offset: 0x0002AF74
public void EndDisconnect(IAsyncResult asyncResult)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (asyncResult == null)
{
throw new ArgumentNullException("asyncResult");
}
Socket.SocketAsyncResult socketAsyncResult = asyncResult as Socket.SocketAsyncResult;
if (socketAsyncResult == null)
{
throw new ArgumentException("Invalid IAsyncResult", "asyncResult");
}
if (Interlocked.CompareExchange(ref socketAsyncResult.EndCalled, 1, 0) == 1)
{
throw this.InvalidAsyncOp("EndDisconnect");
}
if (!asyncResult.IsCompleted)
{
asyncResult.AsyncWaitHandle.WaitOne();
}
socketAsyncResult.CheckIfThrowDelayedException();
}
/// Ends a pending asynchronous read.
/// The number of bytes received.
/// An that stores state information and any user defined data for this asynchronous operation.
///
/// is null.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous read.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
// Token: 0x06000FE9 RID: 4073 RVA: 0x0002CE14 File Offset: 0x0002B014
public int EndReceive(IAsyncResult result)
{
SocketError socketError;
return this.EndReceive(result, out socketError);
}
/// Ends a pending asynchronous read.
/// The number of bytes received.
/// An that stores state information and any user defined data for this asynchronous operation.
/// A object that stores the socket error.
///
/// is null.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous read.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
// Token: 0x06000FEA RID: 4074 RVA: 0x0002CE2C File Offset: 0x0002B02C
public int EndReceive(IAsyncResult asyncResult, out SocketError errorCode)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (asyncResult == null)
{
throw new ArgumentNullException("asyncResult");
}
Socket.SocketAsyncResult socketAsyncResult = asyncResult as Socket.SocketAsyncResult;
if (socketAsyncResult == null)
{
throw new ArgumentException("Invalid IAsyncResult", "asyncResult");
}
if (Interlocked.CompareExchange(ref socketAsyncResult.EndCalled, 1, 0) == 1)
{
throw this.InvalidAsyncOp("EndReceive");
}
if (!asyncResult.IsCompleted)
{
asyncResult.AsyncWaitHandle.WaitOne();
}
errorCode = socketAsyncResult.ErrorCode;
socketAsyncResult.CheckIfThrowDelayedException();
return socketAsyncResult.Total;
}
/// Ends a pending asynchronous read from a specific endpoint.
/// If successful, the number of bytes received. If unsuccessful, returns 0.
/// An that stores state information and any user defined data for this asynchronous operation.
/// The source .
///
/// is null.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous read.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
// Token: 0x06000FEB RID: 4075 RVA: 0x0002CED8 File Offset: 0x0002B0D8
public int EndReceiveFrom(IAsyncResult result, ref EndPoint end_point)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (result == null)
{
throw new ArgumentNullException("result");
}
Socket.SocketAsyncResult socketAsyncResult = result as Socket.SocketAsyncResult;
if (socketAsyncResult == null)
{
throw new ArgumentException("Invalid IAsyncResult", "result");
}
if (Interlocked.CompareExchange(ref socketAsyncResult.EndCalled, 1, 0) == 1)
{
throw this.InvalidAsyncOp("EndReceiveFrom");
}
if (!result.IsCompleted)
{
result.AsyncWaitHandle.WaitOne();
}
socketAsyncResult.CheckIfThrowDelayedException();
end_point = socketAsyncResult.EndPoint;
return socketAsyncResult.Total;
}
/// Ends a pending asynchronous read from a specific endpoint. This method also reveals more information about the packet than .
/// If successful, the number of bytes received. If unsuccessful, returns 0.
/// An that stores state information and any user defined data for this asynchronous operation.
/// A bitwise combination of the values for the received packet.
/// The source .
/// The and interface of the received packet.
///
/// is null-or- is null.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous read.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
// Token: 0x06000FEC RID: 4076 RVA: 0x0002CF84 File Offset: 0x0002B184
[global::System.MonoTODO]
public int EndReceiveMessageFrom(IAsyncResult asyncResult, ref SocketFlags socketFlags, ref EndPoint endPoint, out IPPacketInformation ipPacketInformation)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (asyncResult == null)
{
throw new ArgumentNullException("asyncResult");
}
if (endPoint == null)
{
throw new ArgumentNullException("endPoint");
}
Socket.SocketAsyncResult socketAsyncResult = asyncResult as Socket.SocketAsyncResult;
if (socketAsyncResult == null)
{
throw new ArgumentException("Invalid IAsyncResult", "asyncResult");
}
if (Interlocked.CompareExchange(ref socketAsyncResult.EndCalled, 1, 0) == 1)
{
throw this.InvalidAsyncOp("EndReceiveMessageFrom");
}
throw new NotImplementedException();
}
/// Ends a pending asynchronous send.
/// If successful, the number of bytes sent to the ; otherwise, an invalid error.
/// An that stores state information for this asynchronous operation.
///
/// is null.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous send.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
// Token: 0x06000FED RID: 4077 RVA: 0x0002D01C File Offset: 0x0002B21C
public int EndSend(IAsyncResult result)
{
SocketError socketError;
return this.EndSend(result, out socketError);
}
/// Ends a pending asynchronous send.
/// If successful, the number of bytes sent to the ; otherwise, an invalid error.
/// An that stores state information for this asynchronous operation.
/// A object that stores the socket error.
///
/// is null.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous send.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
// Token: 0x06000FEE RID: 4078 RVA: 0x0002D034 File Offset: 0x0002B234
public int EndSend(IAsyncResult asyncResult, out SocketError errorCode)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (asyncResult == null)
{
throw new ArgumentNullException("asyncResult");
}
Socket.SocketAsyncResult socketAsyncResult = asyncResult as Socket.SocketAsyncResult;
if (socketAsyncResult == null)
{
throw new ArgumentException("Invalid IAsyncResult", "result");
}
if (Interlocked.CompareExchange(ref socketAsyncResult.EndCalled, 1, 0) == 1)
{
throw this.InvalidAsyncOp("EndSend");
}
if (!asyncResult.IsCompleted)
{
asyncResult.AsyncWaitHandle.WaitOne();
}
errorCode = socketAsyncResult.ErrorCode;
socketAsyncResult.CheckIfThrowDelayedException();
return socketAsyncResult.Total;
}
/// Ends a pending asynchronous send of a file.
/// An object that stores state information for this asynchronous operation.
/// Windows NT is required for this method.
/// The object has been closed.
///
/// is empty.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous .
/// An error occurred when attempting to access the socket. See remarks section below.
///
///
///
///
///
// Token: 0x06000FEF RID: 4079 RVA: 0x0002D0E0 File Offset: 0x0002B2E0
public void EndSendFile(IAsyncResult asyncResult)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (asyncResult == null)
{
throw new ArgumentNullException("asyncResult");
}
Socket.SendFileAsyncResult sendFileAsyncResult = asyncResult as Socket.SendFileAsyncResult;
if (sendFileAsyncResult == null)
{
throw new ArgumentException("Invalid IAsyncResult", "asyncResult");
}
sendFileAsyncResult.Delegate.EndInvoke(sendFileAsyncResult.Original);
}
// Token: 0x06000FF0 RID: 4080 RVA: 0x0002D154 File Offset: 0x0002B354
private Exception InvalidAsyncOp(string method)
{
return new InvalidOperationException(method + " can only be called once per asynchronous operation");
}
/// Ends a pending asynchronous send to a specific location.
/// If successful, the number of bytes sent; otherwise, an invalid error.
/// An that stores state information and any user defined data for this asynchronous operation.
///
/// is null.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous send.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
// Token: 0x06000FF1 RID: 4081 RVA: 0x0002D168 File Offset: 0x0002B368
public int EndSendTo(IAsyncResult result)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (result == null)
{
throw new ArgumentNullException("result");
}
Socket.SocketAsyncResult socketAsyncResult = result as Socket.SocketAsyncResult;
if (socketAsyncResult == null)
{
throw new ArgumentException("Invalid IAsyncResult", "result");
}
if (Interlocked.CompareExchange(ref socketAsyncResult.EndCalled, 1, 0) == 1)
{
throw this.InvalidAsyncOp("EndSendTo");
}
if (!result.IsCompleted)
{
result.AsyncWaitHandle.WaitOne();
}
socketAsyncResult.CheckIfThrowDelayedException();
return socketAsyncResult.Total;
}
// Token: 0x06000FF2 RID: 4082
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void GetSocketOption_arr_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val, out int error);
/// Returns the specified option setting, represented as a byte array.
/// One of the values.
/// One of the values.
/// An array of type that is to receive the option setting.
/// An error occurred when attempting to access the socket. See the Remarks section for more information. - or -In .NET Compact Framework applications, the Windows CE default buffer space is set to 32768 bytes. You can change the per socket buffer space by calling .
/// The has been closed.
///
///
///
///
///
// Token: 0x06000FF3 RID: 4083 RVA: 0x0002D20C File Offset: 0x0002B40C
public void GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (optionValue == null)
{
throw new SocketException(10014, "Error trying to dereference an invalid pointer");
}
int num;
Socket.GetSocketOption_arr_internal(this.socket, optionLevel, optionName, ref optionValue, out num);
if (num != 0)
{
throw new SocketException(num);
}
}
/// Returns the value of the specified option in an array.
/// An array of type that contains the value of the socket option.
/// One of the values.
/// One of the values.
/// The length, in bytes, of the expected return value.
/// An error occurred when attempting to access the socket. See the Remarks section for more information. - or -In .NET Compact Framework applications, the Windows CE default buffer space is set to 32768 bytes. You can change the per socket buffer space by calling .
/// The has been closed.
///
///
///
///
///
// Token: 0x06000FF4 RID: 4084 RVA: 0x0002D274 File Offset: 0x0002B474
public byte[] GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, int length)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
byte[] array = new byte[length];
int num;
Socket.GetSocketOption_arr_internal(this.socket, optionLevel, optionName, ref array, out num);
if (num != 0)
{
throw new SocketException(num);
}
return array;
}
// Token: 0x06000FF5 RID: 4085
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int WSAIoctl(IntPtr sock, int ioctl_code, byte[] input, byte[] output, out int error);
/// Sets low-level operating modes for the using numerical control codes.
/// The number of bytes in the parameter.
/// An value that specifies the control code of the operation to perform.
/// A array that contains the input data required by the operation.
/// A array that contains the output data returned by the operation.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// An attempt was made to change the blocking mode without using the property.
/// A caller in the call stack does not have the required permissions.
///
///
///
///
///
// Token: 0x06000FF6 RID: 4086 RVA: 0x0002D2D0 File Offset: 0x0002B4D0
public int IOControl(int ioctl_code, byte[] in_value, byte[] out_value)
{
if (this.disposed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
int num2;
int num = Socket.WSAIoctl(this.socket, ioctl_code, in_value, out_value, out num2);
if (num2 != 0)
{
throw new SocketException(num2);
}
if (num == -1)
{
throw new InvalidOperationException("Must use Blocking property instead.");
}
return num;
}
/// Sets low-level operating modes for the using the enumeration to specify control codes.
/// The number of bytes in the parameter.
/// A value that specifies the control code of the operation to perform.
/// An array of type that contains the input data required by the operation.
/// An array of type that contains the output data returned by the operation.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// An attempt was made to change the blocking mode without using the property.
///
///
///
///
///
// Token: 0x06000FF7 RID: 4087 RVA: 0x0002D32C File Offset: 0x0002B52C
[global::System.MonoTODO]
public int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
{
throw new NotImplementedException();
}
// Token: 0x06000FF8 RID: 4088
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Listen_internal(IntPtr sock, int backlog, out int error);
/// Places a in a listening state.
/// The maximum length of the pending connections queue.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x06000FF9 RID: 4089 RVA: 0x0002D334 File Offset: 0x0002B534
public void Listen(int backlog)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (!this.isbound)
{
throw new SocketException(10022);
}
if (Environment.SocketSecurityEnabled)
{
SecurityException ex = new SecurityException("Listening on TCP sockets is not allowed in the webplayer");
Console.WriteLine("Throwing the following securityexception: " + ex);
throw ex;
}
int num;
Socket.Listen_internal(this.socket, backlog, out num);
if (num != 0)
{
throw new SocketException(num);
}
this.islistening = true;
}
/// Determines the status of the .
/// The status of the based on the polling mode value passed in the parameter.Mode Return Value true if has been called and a connection is pending; -or- true if data is available for reading; -or- true if the connection has been closed, reset, or terminated; otherwise, returns false. true, if processing a , and the connection has succeeded; -or- true if data can be sent; otherwise, returns false. true if processing a that does not block, and the connection has failed; -or- true if is not set and out-of-band data is available; otherwise, returns false.
/// The time to wait for a response, in microseconds.
/// One of the values.
/// The parameter is not one of the values.
/// An error occurred when attempting to access the socket. See remarks below.
/// The has been closed.
///
///
///
///
///
// Token: 0x06000FFA RID: 4090 RVA: 0x0002D3C8 File Offset: 0x0002B5C8
public bool Poll(int time_us, SelectMode mode)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (mode != SelectMode.SelectRead && mode != SelectMode.SelectWrite && mode != SelectMode.SelectError)
{
throw new NotSupportedException("'mode' parameter is not valid.");
}
int num;
bool flag = Socket.Poll_internal(this.socket, mode, time_us, out num);
if (num != 0)
{
throw new SocketException(num);
}
if (mode == SelectMode.SelectWrite && flag && !this.connected && (int)this.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Error) == 0)
{
this.connected = true;
}
return flag;
}
/// Receives data from a bound into a receive buffer.
/// The number of bytes received.
/// An array of type that is the storage location for the received data.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// A caller in the call stack does not have the required permissions.
///
///
///
///
///
///
// Token: 0x06000FFB RID: 4091 RVA: 0x0002D474 File Offset: 0x0002B674
public int Receive(byte[] buffer)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
SocketError socketError;
int num = this.Receive_nochecks(buffer, 0, buffer.Length, SocketFlags.None, out socketError);
if (socketError != SocketError.Success)
{
throw new SocketException((int)socketError);
}
return num;
}
/// Receives data from a bound into a receive buffer, using the specified .
/// The number of bytes received.
/// An array of type that is the storage location for the received data.
/// A bitwise combination of the values.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// A caller in the call stack does not have the required permissions.
///
///
///
///
///
///
// Token: 0x06000FFC RID: 4092 RVA: 0x0002D4D8 File Offset: 0x0002B6D8
public int Receive(byte[] buffer, SocketFlags flags)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
SocketError socketError;
int num = this.Receive_nochecks(buffer, 0, buffer.Length, flags, out socketError);
if (socketError == SocketError.Success)
{
return num;
}
if (socketError == SocketError.WouldBlock && this.blocking)
{
throw new SocketException((int)socketError, "Operation timed out.");
}
throw new SocketException((int)socketError);
}
/// Receives the specified number of bytes of data from a bound into a receive buffer, using the specified .
/// The number of bytes received.
/// An array of type that is the storage location for the received data.
/// The number of bytes to receive.
/// A bitwise combination of the values.
///
/// is null.
///
/// exceeds the size of .
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// A caller in the call stack does not have the required permissions.
///
///
///
///
///
///
// Token: 0x06000FFD RID: 4093 RVA: 0x0002D55C File Offset: 0x0002B75C
public int Receive(byte[] buffer, int size, SocketFlags flags)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (size < 0 || size > buffer.Length)
{
throw new ArgumentOutOfRangeException("size");
}
SocketError socketError;
int num = this.Receive_nochecks(buffer, 0, size, flags, out socketError);
if (socketError == SocketError.Success)
{
return num;
}
if (socketError == SocketError.WouldBlock && this.blocking)
{
throw new SocketException((int)socketError, "Operation timed out.");
}
throw new SocketException((int)socketError);
}
/// Receives the specified number of bytes from a bound into the specified offset position of the receive buffer, using the specified .
/// The number of bytes received.
/// An array of type that is the storage location for received data.
/// The location in to store the received data.
/// The number of bytes to receive.
/// A bitwise combination of the values.
///
/// is null.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
///
/// is not a valid combination of values.-or- The property was not set.-or- An operating system error occurs while accessing the .
/// The has been closed.
/// A caller in the call stack does not have the required permissions.
///
///
///
///
///
///
// Token: 0x06000FFE RID: 4094 RVA: 0x0002D5FC File Offset: 0x0002B7FC
public int Receive(byte[] buffer, int offset, int size, SocketFlags flags)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0 || offset > buffer.Length)
{
throw new ArgumentOutOfRangeException("offset");
}
if (size < 0 || offset + size > buffer.Length)
{
throw new ArgumentOutOfRangeException("size");
}
SocketError socketError;
int num = this.Receive_nochecks(buffer, offset, size, flags, out socketError);
if (socketError == SocketError.Success)
{
return num;
}
if (socketError == SocketError.WouldBlock && this.blocking)
{
throw new SocketException((int)socketError, "Operation timed out.");
}
throw new SocketException((int)socketError);
}
/// Receives data from a bound into a receive buffer, using the specified .
/// The number of bytes received.
/// An array of type that is the storage location for the received data.
/// The position in the parameter to store the received data.
/// The number of bytes to receive.
/// A bitwise combination of the values.
/// A object that stores the socket error.
///
/// is null.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
///
/// is not a valid combination of values.-or- The property is not set.-or- An operating system error occurs while accessing the .
/// The has been closed.
/// A caller in the call stack does not have the required permissions.
// Token: 0x06000FFF RID: 4095 RVA: 0x0002D6B8 File Offset: 0x0002B8B8
public int Receive(byte[] buffer, int offset, int size, SocketFlags flags, out SocketError error)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0 || offset > buffer.Length)
{
throw new ArgumentOutOfRangeException("offset");
}
if (size < 0 || offset + size > buffer.Length)
{
throw new ArgumentOutOfRangeException("size");
}
return this.Receive_nochecks(buffer, offset, size, flags, out error);
}
// Token: 0x06001000 RID: 4096
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int Receive_internal(IntPtr sock, Socket.WSABUF[] bufarray, SocketFlags flags, out int error);
/// Receives data from a bound into the list of receive buffers.
/// The number of bytes received.
/// A list of s of type that contains the received data.
/// The parameter is null.
/// An error occurred while attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
// Token: 0x06001001 RID: 4097 RVA: 0x0002D744 File Offset: 0x0002B944
public int Receive(IList> buffers)
{
SocketError socketError;
int num = this.Receive(buffers, SocketFlags.None, out socketError);
if (socketError != SocketError.Success)
{
throw new SocketException((int)socketError);
}
return num;
}
/// Receives data from a bound into the list of receive buffers, using the specified .
/// The number of bytes received.
/// A list of s of type that contains the received data.
/// A bitwise combination of the values.
///
/// is null.-or-.Count is zero.
/// An error occurred while attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
// Token: 0x06001002 RID: 4098 RVA: 0x0002D76C File Offset: 0x0002B96C
[CLSCompliant(false)]
public int Receive(IList> buffers, SocketFlags socketFlags)
{
SocketError socketError;
int num = this.Receive(buffers, socketFlags, out socketError);
if (socketError != SocketError.Success)
{
throw new SocketException((int)socketError);
}
return num;
}
/// Receives data from a bound into the list of receive buffers, using the specified .
/// The number of bytes received.
/// A list of s of type that contains the received data.
/// A bitwise combination of the values.
/// A object that stores the socket error.
///
/// is null.-or-.Count is zero.
/// An error occurred while attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
// Token: 0x06001003 RID: 4099 RVA: 0x0002D794 File Offset: 0x0002B994
[CLSCompliant(false)]
public int Receive(IList> buffers, SocketFlags socketFlags, out SocketError errorCode)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffers == null || buffers.Count == 0)
{
throw new ArgumentNullException("buffers");
}
int count = buffers.Count;
Socket.WSABUF[] array = new Socket.WSABUF[count];
GCHandle[] array2 = new GCHandle[count];
for (int i = 0; i < count; i++)
{
ArraySegment arraySegment = buffers[i];
array2[i] = GCHandle.Alloc(arraySegment.Array, GCHandleType.Pinned);
array[i].len = arraySegment.Count;
array[i].buf = Marshal.UnsafeAddrOfPinnedArrayElement(arraySegment.Array, arraySegment.Offset);
}
int num2;
int num;
try
{
num = Socket.Receive_internal(this.socket, array, socketFlags, out num2);
}
finally
{
for (int j = 0; j < count; j++)
{
if (array2[j].IsAllocated)
{
array2[j].Free();
}
}
}
errorCode = (SocketError)num2;
return num;
}
/// Begins to asynchronously receive data from a specified network device.
/// Returns true if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the parameter will not be raised and the object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.
/// The object to use for this asynchronous socket operation.
/// The cannot be null.
/// A socket operation was already in progress using the object specified in the parameter.
/// Windows XP or later is required for this method.
/// The has been closed.
/// An error occurred when attempting to access the socket.
// Token: 0x06001004 RID: 4100 RVA: 0x0002D8D8 File Offset: 0x0002BAD8
public bool ReceiveFromAsync(SocketAsyncEventArgs e)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (e.BufferList != null)
{
throw new NotSupportedException("Mono doesn't support using BufferList at this point.");
}
if (e.RemoteEndPoint == null)
{
throw new ArgumentNullException("remoteEP", "Value cannot be null.");
}
e.DoOperation(SocketAsyncOperation.ReceiveFrom, this);
return true;
}
/// Receives a datagram into the data buffer and stores the endpoint.
/// The number of bytes received.
/// An array of type that is the storage location for received data.
/// An , passed by reference, that represents the remote server.
///
/// is null.-or- is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// A caller in the call stack does not have the required permissions.
///
///
///
///
///
///
///
// Token: 0x06001005 RID: 4101 RVA: 0x0002D948 File Offset: 0x0002BB48
public int ReceiveFrom(byte[] buffer, ref EndPoint remoteEP)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (remoteEP == null)
{
throw new ArgumentNullException("remoteEP");
}
return this.ReceiveFrom_nochecks(buffer, 0, buffer.Length, SocketFlags.None, ref remoteEP);
}
/// Receives a datagram into the data buffer, using the specified , and stores the endpoint.
/// The number of bytes received.
/// An array of type that is the storage location for the received data.
/// A bitwise combination of the values.
/// An , passed by reference, that represents the remote server.
///
/// is null.-or- is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// A caller in the call stack does not have the required permissions.
///
///
///
///
///
///
///
// Token: 0x06001006 RID: 4102 RVA: 0x0002D9AC File Offset: 0x0002BBAC
public int ReceiveFrom(byte[] buffer, SocketFlags flags, ref EndPoint remoteEP)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (remoteEP == null)
{
throw new ArgumentNullException("remoteEP");
}
return this.ReceiveFrom_nochecks(buffer, 0, buffer.Length, flags, ref remoteEP);
}
/// Receives the specified number of bytes into the data buffer, using the specified , and stores the endpoint.
/// The number of bytes received.
/// An array of type that is the storage location for received data.
/// The number of bytes to receive.
/// A bitwise combination of the values.
/// An , passed by reference, that represents the remote server.
///
/// is null.-or- is null.
///
/// is less than 0.-or- is greater than the length of .
///
/// is not a valid combination of values.-or- The property was not set.-or- An operating system error occurs while accessing the .
/// The has been closed.
/// A caller in the call stack does not have the required permissions.
///
///
///
///
///
///
///
// Token: 0x06001007 RID: 4103 RVA: 0x0002DA10 File Offset: 0x0002BC10
public int ReceiveFrom(byte[] buffer, int size, SocketFlags flags, ref EndPoint remoteEP)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (remoteEP == null)
{
throw new ArgumentNullException("remoteEP");
}
if (size < 0 || size > buffer.Length)
{
throw new ArgumentOutOfRangeException("size");
}
return this.ReceiveFrom_nochecks(buffer, 0, size, flags, ref remoteEP);
}
// Token: 0x06001008 RID: 4104
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int RecvFrom_internal(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error);
/// Receives the specified number of bytes of data into the specified location of the data buffer, using the specified , and stores the endpoint.
/// The number of bytes received.
/// An array of type that is the storage location for received data.
/// The position in the parameter to store the received data.
/// The number of bytes to receive.
/// A bitwise combination of the values.
/// An , passed by reference, that represents the remote server.
///
/// is null.-or- is null.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of the minus the value of the offset parameter.
///
/// is not a valid combination of values.-or- The property was not set.-or- An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
///
// Token: 0x06001009 RID: 4105 RVA: 0x0002DA90 File Offset: 0x0002BC90
public int ReceiveFrom(byte[] buffer, int offset, int size, SocketFlags flags, ref EndPoint remoteEP)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (remoteEP == null)
{
throw new ArgumentNullException("remoteEP");
}
if (offset < 0 || offset > buffer.Length)
{
throw new ArgumentOutOfRangeException("offset");
}
if (size < 0 || offset + size > buffer.Length)
{
throw new ArgumentOutOfRangeException("size");
}
return this.ReceiveFrom_nochecks(buffer, offset, size, flags, ref remoteEP);
}
// Token: 0x0600100A RID: 4106 RVA: 0x0002DB30 File Offset: 0x0002BD30
internal int ReceiveFrom_nochecks(byte[] buf, int offset, int size, SocketFlags flags, ref EndPoint remote_end)
{
int num;
return this.ReceiveFrom_nochecks_exc(buf, offset, size, flags, ref remote_end, true, out num);
}
// Token: 0x0600100B RID: 4107 RVA: 0x0002DB50 File Offset: 0x0002BD50
internal int ReceiveFrom_nochecks_exc(byte[] buf, int offset, int size, SocketFlags flags, ref EndPoint remote_end, bool throwOnError, out int error)
{
SocketAddress socketAddress = remote_end.Serialize();
int num = Socket.RecvFrom_internal(this.socket, buf, offset, size, flags, ref socketAddress, out error);
SocketError socketError = (SocketError)error;
if (socketError != SocketError.Success)
{
if (socketError != SocketError.WouldBlock && socketError != SocketError.InProgress)
{
this.connected = false;
}
else if (socketError == SocketError.WouldBlock && this.blocking)
{
if (throwOnError)
{
throw new SocketException(10060, "Operation timed out");
}
error = 10060;
return 0;
}
if (throwOnError)
{
throw new SocketException(error);
}
return 0;
}
else
{
if (Environment.SocketSecurityEnabled && !Socket.CheckEndPoint(socketAddress))
{
buf.Initialize();
throw new SecurityException("Unable to connect, as no valid crossdomain policy was found");
}
this.connected = true;
this.isbound = true;
if (socketAddress != null)
{
remote_end = remote_end.Create(socketAddress);
}
this.seed_endpoint = remote_end;
return num;
}
}
/// Begins to asynchronously receive the specified number of bytes of data into the specified location in the data buffer, using the specified , and stores the endpoint and packet information.
/// Returns true if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the parameter will not be raised and the object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.
/// The object to use for this asynchronous socket operation.
/// The cannot be null.
/// Windows XP or later is required for this method.
/// The has been closed.
/// An error occurred when attempting to access the socket.
// Token: 0x0600100C RID: 4108 RVA: 0x0002DC40 File Offset: 0x0002BE40
[global::System.MonoTODO("Not implemented")]
public bool ReceiveMessageFromAsync(SocketAsyncEventArgs e)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
throw new NotImplementedException();
}
/// Receives the specified number of bytes of data into the specified location of the data buffer, using the specified , and stores the endpoint and packet information.
/// The number of bytes received.
/// An array of type that is the storage location for received data.
/// The position in the parameter to store the received data.
/// The number of bytes to receive.
/// A bitwise combination of the values.
/// An , passed by reference, that represents the remote server.
/// An holding address and interface information.
///
/// is null.- or- is null.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of the minus the value of the offset parameter.
///
/// is not a valid combination of values.-or- The property was not set.-or- The .NET Framework is running on an AMD 64-bit processor.-or- An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// The operating system is Windows 2000 or earlier, and this method requires Windows XP.
// Token: 0x0600100D RID: 4109 RVA: 0x0002DC7C File Offset: 0x0002BE7C
[global::System.MonoTODO("Not implemented")]
public int ReceiveMessageFrom(byte[] buffer, int offset, int size, ref SocketFlags socketFlags, ref EndPoint remoteEP, out IPPacketInformation ipPacketInformation)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (remoteEP == null)
{
throw new ArgumentNullException("remoteEP");
}
if (offset < 0 || offset > buffer.Length)
{
throw new ArgumentOutOfRangeException("offset");
}
if (size < 0 || offset + size > buffer.Length)
{
throw new ArgumentOutOfRangeException("size");
}
throw new NotImplementedException();
}
/// Sends a collection of files or in memory data buffers asynchronously to a connected object.
/// Returns true if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the parameter will not be raised and the object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.
/// The object to use for this asynchronous socket operation.
/// The file specified in the property was not found.
/// A socket operation was already in progress using the object specified in the parameter.
/// Windows XP or later is required for this method. This exception also occurs if the is not connected to a remote host.
/// The has been closed.
/// A connectionless is being used and the file being sent exceeds the maximum packet size of the underlying transport.
// Token: 0x0600100E RID: 4110 RVA: 0x0002DD14 File Offset: 0x0002BF14
[global::System.MonoTODO("Not implemented")]
public bool SendPacketsAsync(SocketAsyncEventArgs e)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
throw new NotImplementedException();
}
/// Sends data to a connected .
/// The number of bytes sent to the .
/// An array of type that contains the data to be sent.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
// Token: 0x0600100F RID: 4111 RVA: 0x0002DD50 File Offset: 0x0002BF50
public int Send(byte[] buf)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buf == null)
{
throw new ArgumentNullException("buf");
}
SocketError socketError;
int num = this.Send_nochecks(buf, 0, buf.Length, SocketFlags.None, out socketError);
if (socketError != SocketError.Success)
{
throw new SocketException((int)socketError);
}
return num;
}
/// Sends data to a connected using the specified .
/// The number of bytes sent to the .
/// An array of type that contains the data to be sent.
/// A bitwise combination of the values.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
// Token: 0x06001010 RID: 4112 RVA: 0x0002DDB4 File Offset: 0x0002BFB4
public int Send(byte[] buf, SocketFlags flags)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buf == null)
{
throw new ArgumentNullException("buf");
}
SocketError socketError;
int num = this.Send_nochecks(buf, 0, buf.Length, flags, out socketError);
if (socketError != SocketError.Success)
{
throw new SocketException((int)socketError);
}
return num;
}
/// Sends the specified number of bytes of data to a connected , using the specified .
/// The number of bytes sent to the .
/// An array of type that contains the data to be sent.
/// The number of bytes to send.
/// A bitwise combination of the values.
///
/// is null.
///
/// is less than 0 or exceeds the size of the buffer.
///
/// is not a valid combination of values.-or- An operating system error occurs while accessing the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
// Token: 0x06001011 RID: 4113 RVA: 0x0002DE18 File Offset: 0x0002C018
public int Send(byte[] buf, int size, SocketFlags flags)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buf == null)
{
throw new ArgumentNullException("buf");
}
if (size < 0 || size > buf.Length)
{
throw new ArgumentOutOfRangeException("size");
}
SocketError socketError;
int num = this.Send_nochecks(buf, 0, size, flags, out socketError);
if (socketError != SocketError.Success)
{
throw new SocketException((int)socketError);
}
return num;
}
/// Sends the specified number of bytes of data to a connected , starting at the specified offset, and using the specified .
/// The number of bytes sent to the .
/// An array of type that contains the data to be sent.
/// The position in the data buffer at which to begin sending data.
/// The number of bytes to send.
/// A bitwise combination of the values.
///
/// is null.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
///
/// is not a valid combination of values.-or- An operating system error occurs while accessing the . See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
// Token: 0x06001012 RID: 4114 RVA: 0x0002DE94 File Offset: 0x0002C094
public int Send(byte[] buf, int offset, int size, SocketFlags flags)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buf == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0 || offset > buf.Length)
{
throw new ArgumentOutOfRangeException("offset");
}
if (size < 0 || offset + size > buf.Length)
{
throw new ArgumentOutOfRangeException("size");
}
SocketError socketError;
int num = this.Send_nochecks(buf, offset, size, flags, out socketError);
if (socketError != SocketError.Success)
{
throw new SocketException((int)socketError);
}
return num;
}
/// Sends the specified number of bytes of data to a connected , starting at the specified offset, and using the specified
/// The number of bytes sent to the .
/// An array of type that contains the data to be sent.
/// The position in the data buffer at which to begin sending data.
/// The number of bytes to send.
/// A bitwise combination of the values.
/// A object that stores the socket error.
///
/// is null.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
///
/// is not a valid combination of values.-or- An operating system error occurs while accessing the . See the Remarks section for more information.
/// The has been closed.
// Token: 0x06001013 RID: 4115 RVA: 0x0002DF30 File Offset: 0x0002C130
public int Send(byte[] buf, int offset, int size, SocketFlags flags, out SocketError error)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buf == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0 || offset > buf.Length)
{
throw new ArgumentOutOfRangeException("offset");
}
if (size < 0 || offset + size > buf.Length)
{
throw new ArgumentOutOfRangeException("size");
}
return this.Send_nochecks(buf, offset, size, flags, out error);
}
// Token: 0x06001014 RID: 4116
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int Send_internal(IntPtr sock, Socket.WSABUF[] bufarray, SocketFlags flags, out int error);
/// Sends the set of buffers in the list to a connected .
/// The number of bytes sent to the .
/// A list of s of type that contains the data to be sent.
///
/// is null.
///
/// is empty.
/// An error occurred when attempting to access the socket. See remarks section below.
/// The has been closed.
// Token: 0x06001015 RID: 4117 RVA: 0x0002DFBC File Offset: 0x0002C1BC
public int Send(IList> buffers)
{
SocketError socketError;
int num = this.Send(buffers, SocketFlags.None, out socketError);
if (socketError != SocketError.Success)
{
throw new SocketException((int)socketError);
}
return num;
}
/// Sends the set of buffers in the list to a connected , using the specified .
/// The number of bytes sent to the .
/// A list of s of type that contains the data to be sent.
/// A bitwise combination of the values.
///
/// is null.
///
/// is empty.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
// Token: 0x06001016 RID: 4118 RVA: 0x0002DFE4 File Offset: 0x0002C1E4
public int Send(IList> buffers, SocketFlags socketFlags)
{
SocketError socketError;
int num = this.Send(buffers, socketFlags, out socketError);
if (socketError != SocketError.Success)
{
throw new SocketException((int)socketError);
}
return num;
}
/// Sends the set of buffers in the list to a connected , using the specified .
/// The number of bytes sent to the .
/// A list of s of type that contains the data to be sent.
/// A bitwise combination of the values.
/// A object that stores the socket error.
///
/// is null.
///
/// is empty.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
// Token: 0x06001017 RID: 4119 RVA: 0x0002E00C File Offset: 0x0002C20C
[CLSCompliant(false)]
public int Send(IList> buffers, SocketFlags socketFlags, out SocketError errorCode)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffers == null)
{
throw new ArgumentNullException("buffers");
}
if (buffers.Count == 0)
{
throw new ArgumentException("Buffer is empty", "buffers");
}
int count = buffers.Count;
Socket.WSABUF[] array = new Socket.WSABUF[count];
GCHandle[] array2 = new GCHandle[count];
for (int i = 0; i < count; i++)
{
ArraySegment arraySegment = buffers[i];
array2[i] = GCHandle.Alloc(arraySegment.Array, GCHandleType.Pinned);
array[i].len = arraySegment.Count;
array[i].buf = Marshal.UnsafeAddrOfPinnedArrayElement(arraySegment.Array, arraySegment.Offset);
}
int num2;
int num;
try
{
num = Socket.Send_internal(this.socket, array, socketFlags, out num2);
}
finally
{
for (int j = 0; j < count; j++)
{
if (array2[j].IsAllocated)
{
array2[j].Free();
}
}
}
errorCode = (SocketError)num2;
return num;
}
// Token: 0x06001018 RID: 4120
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool SendFile(IntPtr sock, string filename, byte[] pre_buffer, byte[] post_buffer, TransmitFileOptions flags);
/// Sends the file to a connected object with the transmit flag.
/// A that contains the path and name of the file to be sent. This parameter can be null.
/// The socket is not connected to a remote host.
/// The object has been closed.
/// The object is not in blocking mode and cannot accept this synchronous call.
/// The file was not found.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
///
///
///
// Token: 0x06001019 RID: 4121 RVA: 0x0002E160 File Offset: 0x0002C360
public void SendFile(string fileName)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (!this.connected)
{
throw new NotSupportedException();
}
if (!this.blocking)
{
throw new InvalidOperationException();
}
this.SendFile(fileName, null, null, TransmitFileOptions.UseDefaultWorkerThread);
}
/// Sends the file and buffers of data to a connected object using the specified value.
/// A that contains the path and name of the file to be sent. This parameter can be null.
/// A array that contains data to be sent before the file is sent. This parameter can be null.
/// A array that contains data to be sent after the file is sent. This parameter can be null.
/// One or more of values.
/// The operating system is not Windows NT or later.- or - The socket is not connected to a remote host.
/// The object has been closed.
/// The object is not in blocking mode and cannot accept this synchronous call.
/// The file was not found.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
// Token: 0x0600101A RID: 4122 RVA: 0x0002E1C0 File Offset: 0x0002C3C0
public void SendFile(string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (!this.connected)
{
throw new NotSupportedException();
}
if (!this.blocking)
{
throw new InvalidOperationException();
}
if (Socket.SendFile(this.socket, fileName, preBuffer, postBuffer, flags))
{
return;
}
SocketException ex = new SocketException();
if (ex.ErrorCode == 2 || ex.ErrorCode == 3)
{
throw new FileNotFoundException();
}
throw ex;
}
/// Sends data asynchronously to a specific remote host.
/// Returns true if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the parameter will not be raised and the object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.
/// The object to use for this asynchronous socket operation.
/// The cannot be null.
/// A socket operation was already in progress using the object specified in the parameter.
/// Windows XP or later is required for this method.
/// The has been closed.
/// The protocol specified is connection-oriented, but the is not yet connected.
// Token: 0x0600101B RID: 4123 RVA: 0x0002E254 File Offset: 0x0002C454
public bool SendToAsync(SocketAsyncEventArgs e)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (e.RemoteEndPoint == null)
{
throw new ArgumentNullException("remoteEP", "Value cannot be null.");
}
e.DoOperation(SocketAsyncOperation.SendTo, this);
return true;
}
/// Sends data to the specified endpoint.
/// The number of bytes sent.
/// An array of type that contains the data to be sent.
/// The that represents the destination for the data.
///
/// is null.-or- is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
///
// Token: 0x0600101C RID: 4124 RVA: 0x0002E2B0 File Offset: 0x0002C4B0
public int SendTo(byte[] buffer, EndPoint remote_end)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (remote_end == null)
{
throw new ArgumentNullException("remote_end");
}
return this.SendTo_nochecks(buffer, 0, buffer.Length, SocketFlags.None, remote_end);
}
/// Sends data to a specific endpoint using the specified .
/// The number of bytes sent.
/// An array of type that contains the data to be sent.
/// A bitwise combination of the values.
/// The that represents the destination location for the data.
///
/// is null.-or- is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
///
// Token: 0x0600101D RID: 4125 RVA: 0x0002E314 File Offset: 0x0002C514
public int SendTo(byte[] buffer, SocketFlags flags, EndPoint remote_end)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (remote_end == null)
{
throw new ArgumentNullException("remote_end");
}
return this.SendTo_nochecks(buffer, 0, buffer.Length, flags, remote_end);
}
/// Sends the specified number of bytes of data to the specified endpoint using the specified .
/// The number of bytes sent.
/// An array of type that contains the data to be sent.
/// The number of bytes to send.
/// A bitwise combination of the values.
/// The that represents the destination location for the data.
///
/// is null.-or- is null.
/// The specified exceeds the size of .
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
///
///
// Token: 0x0600101E RID: 4126 RVA: 0x0002E378 File Offset: 0x0002C578
public int SendTo(byte[] buffer, int size, SocketFlags flags, EndPoint remote_end)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (remote_end == null)
{
throw new ArgumentNullException("remote_end");
}
if (size < 0 || size > buffer.Length)
{
throw new ArgumentOutOfRangeException("size");
}
return this.SendTo_nochecks(buffer, 0, size, flags, remote_end);
}
// Token: 0x0600101F RID: 4127
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int SendTo_internal_real(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error);
// Token: 0x06001020 RID: 4128 RVA: 0x0002E3F8 File Offset: 0x0002C5F8
private static int SendTo_internal(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error)
{
if (Environment.SocketSecurityEnabled && !Socket.CheckEndPoint(sa))
{
SecurityException ex = new SecurityException("SendTo request refused by Unity webplayer security model");
Console.WriteLine("Throwing the following security exception: " + ex);
throw ex;
}
return Socket.SendTo_internal_real(sock, buffer, offset, count, flags, sa, out error);
}
/// Sends the specified number of bytes of data to the specified endpoint, starting at the specified location in the buffer, and using the specified .
/// The number of bytes sent.
/// An array of type that contains the data to be sent.
/// The position in the data buffer at which to begin sending data.
/// The number of bytes to send.
/// A bitwise combination of the values.
/// The that represents the destination location for the data.
///
/// is null.-or- is null.
///
/// is less than 0.-or- is greater than the length of .-or- is less than 0.-or- is greater than the length of minus the value of the parameter.
///
/// is not a valid combination of values.-or- An operating system error occurs while accessing the . See the Remarks section for more information.
/// The has been closed.
/// A caller in the call stack does not have the required permissions.
///
///
///
///
///
///
///
// Token: 0x06001021 RID: 4129 RVA: 0x0002E44C File Offset: 0x0002C64C
public int SendTo(byte[] buffer, int offset, int size, SocketFlags flags, EndPoint remote_end)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (remote_end == null)
{
throw new ArgumentNullException("remote_end");
}
if (offset < 0 || offset > buffer.Length)
{
throw new ArgumentOutOfRangeException("offset");
}
if (size < 0 || offset + size > buffer.Length)
{
throw new ArgumentOutOfRangeException("size");
}
return this.SendTo_nochecks(buffer, offset, size, flags, remote_end);
}
// Token: 0x06001022 RID: 4130 RVA: 0x0002E4E8 File Offset: 0x0002C6E8
internal int SendTo_nochecks(byte[] buffer, int offset, int size, SocketFlags flags, EndPoint remote_end)
{
SocketAddress socketAddress = remote_end.Serialize();
int num2;
int num = Socket.SendTo_internal(this.socket, buffer, offset, size, flags, socketAddress, out num2);
SocketError socketError = (SocketError)num2;
if (socketError != SocketError.Success)
{
if (socketError != SocketError.WouldBlock && socketError != SocketError.InProgress)
{
this.connected = false;
}
throw new SocketException(num2);
}
this.connected = true;
this.isbound = true;
this.seed_endpoint = remote_end;
return num;
}
/// Sets the specified option to the specified value, represented as a byte array.
/// One of the values.
/// One of the values.
/// An array of type that represents the value of the option.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x06001023 RID: 4131 RVA: 0x0002E554 File Offset: 0x0002C754
public void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (optionValue == null)
{
throw new SocketException(10014, "Error trying to dereference an invalid pointer");
}
int num;
Socket.SetSocketOption_internal(this.socket, optionLevel, optionName, null, optionValue, 0, out num);
if (num == 0)
{
return;
}
if (num == 10022)
{
throw new ArgumentException();
}
throw new SocketException(num);
}
/// Sets the specified option to the specified value, represented as an object.
/// One of the values.
/// One of the values.
/// A or that contains the value of the option.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x06001024 RID: 4132 RVA: 0x0002E5D0 File Offset: 0x0002C7D0
public void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, object optionValue)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (optionValue == null)
{
throw new ArgumentNullException("optionValue");
}
int num;
if (optionLevel == SocketOptionLevel.Socket && optionName == SocketOptionName.Linger)
{
LingerOption lingerOption = optionValue as LingerOption;
if (lingerOption == null)
{
throw new ArgumentException("A 'LingerOption' value must be specified.", "optionValue");
}
Socket.SetSocketOption_internal(this.socket, optionLevel, optionName, lingerOption, null, 0, out num);
}
else if (optionLevel == SocketOptionLevel.IP && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership))
{
MulticastOption multicastOption = optionValue as MulticastOption;
if (multicastOption == null)
{
throw new ArgumentException("A 'MulticastOption' value must be specified.", "optionValue");
}
Socket.SetSocketOption_internal(this.socket, optionLevel, optionName, multicastOption, null, 0, out num);
}
else
{
if (optionLevel != SocketOptionLevel.IPv6 || (optionName != SocketOptionName.AddMembership && optionName != SocketOptionName.DropMembership))
{
throw new ArgumentException("Invalid value specified.", "optionValue");
}
IPv6MulticastOption pv6MulticastOption = optionValue as IPv6MulticastOption;
if (pv6MulticastOption == null)
{
throw new ArgumentException("A 'IPv6MulticastOption' value must be specified.", "optionValue");
}
Socket.SetSocketOption_internal(this.socket, optionLevel, optionName, pv6MulticastOption, null, 0, out num);
}
if (num == 0)
{
return;
}
if (num == 10022)
{
throw new ArgumentException();
}
throw new SocketException(num);
}
/// Sets the specified option to the specified value.
/// One of the values.
/// One of the values.
/// The value of the option, represented as a .
/// The object has been closed.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
///
///
///
///
///
// Token: 0x06001025 RID: 4133 RVA: 0x0002E724 File Offset: 0x0002C924
public void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, bool optionValue)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
int num = ((!optionValue) ? 0 : 1);
int num2;
Socket.SetSocketOption_internal(this.socket, optionLevel, optionName, null, null, num, out num2);
if (num2 == 0)
{
return;
}
if (num2 == 10022)
{
throw new ArgumentException();
}
throw new SocketException(num2);
}
// Token: 0x06001026 RID: 4134 RVA: 0x0002E798 File Offset: 0x0002C998
internal static void CheckProtocolSupport()
{
if (Socket.ipv4Supported == -1)
{
try
{
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Close();
Socket.ipv4Supported = 1;
}
catch
{
Socket.ipv4Supported = 0;
}
}
if (Socket.ipv6Supported == -1 && Socket.ipv6Supported != 0)
{
try
{
Socket socket2 = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
socket2.Close();
Socket.ipv6Supported = 1;
}
catch
{
Socket.ipv6Supported = 0;
}
}
}
/// Gets a value indicating whether IPv4 support is available and enabled on the current host.
/// true if the current host supports the IPv4 protocol; otherwise, false.
// Token: 0x17000565 RID: 1381
// (get) Token: 0x06001027 RID: 4135 RVA: 0x0002E848 File Offset: 0x0002CA48
public static bool SupportsIPv4
{
get
{
Socket.CheckProtocolSupport();
return Socket.ipv4Supported == 1;
}
}
/// Gets a value that indicates whether the Framework supports IPv6 for certain obsolete members.
/// true if the Framework supports IPv6 for certain obsolete methods; otherwise, false.
// Token: 0x17000566 RID: 1382
// (get) Token: 0x06001028 RID: 4136 RVA: 0x0002E858 File Offset: 0x0002CA58
[Obsolete("Use OSSupportsIPv6 instead")]
public static bool SupportsIPv6
{
get
{
Socket.CheckProtocolSupport();
return Socket.ipv6Supported == 1;
}
}
// Token: 0x17000567 RID: 1383
// (get) Token: 0x06001029 RID: 4137 RVA: 0x0002E868 File Offset: 0x0002CA68
public static bool OSSupportsIPv4
{
get
{
Socket.CheckProtocolSupport();
return Socket.ipv4Supported == 1;
}
}
/// Indicates whether the underlying operating system and network adaptors support Internet Protocol version 6 (IPv6).
/// true if the operating system and network adaptors support the IPv6 protocol; otherwise, false.
// Token: 0x17000568 RID: 1384
// (get) Token: 0x0600102A RID: 4138 RVA: 0x0002E878 File Offset: 0x0002CA78
public static bool OSSupportsIPv6
{
get
{
Socket.CheckProtocolSupport();
return Socket.ipv6Supported == 1;
}
}
// Token: 0x0600102B RID: 4139
[MethodImpl(MethodImplOptions.InternalCall)]
private extern IntPtr Socket_internal(AddressFamily family, SocketType type, ProtocolType proto, out int error);
/// Frees resources used by the class.
// Token: 0x0600102C RID: 4140 RVA: 0x0002E888 File Offset: 0x0002CA88
~Socket()
{
this.Dispose(false);
}
/// Gets the address family of the .
/// One of the values.
// Token: 0x17000569 RID: 1385
// (get) Token: 0x0600102D RID: 4141 RVA: 0x0002E8C4 File Offset: 0x0002CAC4
public AddressFamily AddressFamily
{
get
{
return this.address_family;
}
}
// Token: 0x0600102E RID: 4142
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Blocking_internal(IntPtr socket, bool block, out int error);
/// Gets or sets a value that indicates whether the is in blocking mode.
/// true if the will block; otherwise, false. The default is true.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x1700056A RID: 1386
// (get) Token: 0x0600102F RID: 4143 RVA: 0x0002E8CC File Offset: 0x0002CACC
// (set) Token: 0x06001030 RID: 4144 RVA: 0x0002E8D4 File Offset: 0x0002CAD4
public bool Blocking
{
get
{
return this.blocking;
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
int num;
Socket.Blocking_internal(this.socket, value, out num);
if (num != 0)
{
throw new SocketException(num);
}
this.blocking = value;
}
}
/// Gets a value that indicates whether a is connected to a remote host as of the last or operation.
/// true if the was connected to a remote resource as of the most recent operation; otherwise, false.
// Token: 0x1700056B RID: 1387
// (get) Token: 0x06001031 RID: 4145 RVA: 0x0002E92C File Offset: 0x0002CB2C
// (set) Token: 0x06001032 RID: 4146 RVA: 0x0002E934 File Offset: 0x0002CB34
public bool Connected
{
get
{
return this.connected;
}
internal set
{
this.connected = value;
}
}
/// Gets the protocol type of the .
/// One of the values.
// Token: 0x1700056C RID: 1388
// (get) Token: 0x06001033 RID: 4147 RVA: 0x0002E940 File Offset: 0x0002CB40
public ProtocolType ProtocolType
{
get
{
return this.protocol_type;
}
}
/// Gets or sets a value that specifies whether the stream is using the Nagle algorithm.
/// false if the uses the Nagle algorithm; otherwise, true. The default is false.
/// An error occurred when attempting to access the . See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x1700056D RID: 1389
// (get) Token: 0x06001034 RID: 4148 RVA: 0x0002E948 File Offset: 0x0002CB48
// (set) Token: 0x06001035 RID: 4149 RVA: 0x0002E998 File Offset: 0x0002CB98
public bool NoDelay
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
this.ThrowIfUpd();
return (int)this.GetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.Debug) != 0;
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
this.ThrowIfUpd();
this.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.Debug, (!value) ? 0 : 1);
}
}
/// Gets or sets a value that specifies the size of the receive buffer of the .
/// An that contains the size, in bytes, of the receive buffer. The default is 8192.
/// An error occurred when attempting to access the socket.
/// The has been closed.
/// The value specified for a set operation is less than 0.
///
///
///
///
///
// Token: 0x1700056E RID: 1390
// (get) Token: 0x06001036 RID: 4150 RVA: 0x0002E9E8 File Offset: 0x0002CBE8
// (set) Token: 0x06001037 RID: 4151 RVA: 0x0002EA34 File Offset: 0x0002CC34
public int ReceiveBufferSize
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
return (int)this.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer);
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (value < 0)
{
throw new ArgumentOutOfRangeException("value", "The value specified for a set operation is less than zero");
}
this.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, value);
}
}
/// Gets or sets a value that specifies the size of the send buffer of the .
/// An that contains the size, in bytes, of the send buffer. The default is 8192.
/// An error occurred when attempting to access the socket.
/// The has been closed.
/// The value specified for a set operation is less than 0.
///
///
///
///
///
// Token: 0x1700056F RID: 1391
// (get) Token: 0x06001038 RID: 4152 RVA: 0x0002EA90 File Offset: 0x0002CC90
// (set) Token: 0x06001039 RID: 4153 RVA: 0x0002EADC File Offset: 0x0002CCDC
public int SendBufferSize
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
return (int)this.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer);
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (value < 0)
{
throw new ArgumentOutOfRangeException("value", "The value specified for a set operation is less than zero");
}
this.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, value);
}
}
/// Gets or sets a value that specifies the Time To Live (TTL) value of Internet Protocol (IP) packets sent by the .
/// The TTL value.
/// The TTL value can't be set to a negative number.
/// This property can only be retrieved or set for a socket in the or address family.
/// An error occurred when attempting to access the socket. This error is also returned when an attempt was made to set TTL to a value higher than 255.
/// The has been closed.
///
///
///
///
///
// Token: 0x17000570 RID: 1392
// (get) Token: 0x0600103A RID: 4154 RVA: 0x0002EB38 File Offset: 0x0002CD38
// (set) Token: 0x0600103B RID: 4155 RVA: 0x0002EBBC File Offset: 0x0002CDBC
public short Ttl
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
short num;
if (this.address_family == AddressFamily.InterNetwork)
{
num = (short)((int)this.GetSocketOption(SocketOptionLevel.IP, SocketOptionName.ReuseAddress));
}
else
{
if (this.address_family != AddressFamily.InterNetworkV6)
{
throw new NotSupportedException("This property is only valid for InterNetwork and InterNetworkV6 sockets");
}
num = (short)((int)this.GetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.HopLimit));
}
return num;
}
set
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (this.address_family == AddressFamily.InterNetwork)
{
this.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.ReuseAddress, (int)value);
}
else
{
if (this.address_family != AddressFamily.InterNetworkV6)
{
throw new NotSupportedException("This property is only valid for InterNetwork and InterNetworkV6 sockets");
}
this.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.HopLimit, (int)value);
}
}
}
// Token: 0x0600103C RID: 4156
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern SocketAddress RemoteEndPoint_internal(IntPtr socket, out int error);
/// Gets the remote endpoint.
/// The with which the is communicating.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x17000571 RID: 1393
// (get) Token: 0x0600103D RID: 4157 RVA: 0x0002EC34 File Offset: 0x0002CE34
public EndPoint RemoteEndPoint
{
get
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (this.seed_endpoint == null)
{
return null;
}
int num;
SocketAddress socketAddress = Socket.RemoteEndPoint_internal(this.socket, out num);
if (num != 0)
{
throw new SocketException(num);
}
return this.seed_endpoint.Create(socketAddress);
}
}
// Token: 0x0600103E RID: 4158 RVA: 0x0002EC9C File Offset: 0x0002CE9C
private void Linger(IntPtr handle)
{
if (!this.connected || this.linger_timeout <= 0)
{
return;
}
int num;
Socket.Shutdown_internal(handle, SocketShutdown.Receive, out num);
if (num != 0)
{
return;
}
int num2 = this.linger_timeout / 1000;
int num3 = this.linger_timeout % 1000;
if (num3 > 0)
{
Socket.Poll_internal(handle, SelectMode.SelectRead, num3 * 1000, out num);
if (num != 0)
{
return;
}
}
if (num2 > 0)
{
LingerOption lingerOption = new LingerOption(true, num2);
Socket.SetSocketOption_internal(handle, SocketOptionLevel.Socket, SocketOptionName.Linger, lingerOption, null, 0, out num);
}
}
/// Releases the unmanaged resources used by the , and optionally disposes of the managed resources.
/// true to release both managed and unmanaged resources; false to releases only unmanaged resources.
// Token: 0x0600103F RID: 4159 RVA: 0x0002ED30 File Offset: 0x0002CF30
protected virtual void Dispose(bool explicitDisposing)
{
if (this.disposed)
{
return;
}
this.disposed = true;
bool flag = this.connected;
this.connected = false;
if ((int)this.socket != -1)
{
if (Environment.SocketSecurityEnabled && Socket.current_bind_count > 0)
{
Socket.current_bind_count--;
}
this.closed = true;
IntPtr intPtr = this.socket;
this.socket = (IntPtr)(-1);
Thread thread = this.blocking_thread;
if (thread != null)
{
thread.Abort();
this.blocking_thread = null;
}
if (flag)
{
this.Linger(intPtr);
}
int num;
Socket.Close_internal(intPtr, out num);
if (num != 0)
{
throw new SocketException(num);
}
}
}
// Token: 0x06001040 RID: 4160 RVA: 0x0002EDE8 File Offset: 0x0002CFE8
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
// Token: 0x06001041 RID: 4161
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Close_internal(IntPtr socket, out int error);
/// Closes the connection and releases all associated resources.
///
///
///
///
///
// Token: 0x06001042 RID: 4162 RVA: 0x0002EDF8 File Offset: 0x0002CFF8
public void Close()
{
this.linger_timeout = 0;
((IDisposable)this).Dispose();
}
/// Closes the connection and releases all associated resources with a specified timeout to allow queued data to be sent.
/// Wait up to seconds to send any remaining data, then close the socket.
///
///
///
///
///
// Token: 0x06001043 RID: 4163 RVA: 0x0002EE08 File Offset: 0x0002D008
public void Close(int timeout)
{
this.linger_timeout = timeout;
((IDisposable)this).Dispose();
}
// Token: 0x06001044 RID: 4164
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Connect_internal_real(IntPtr sock, SocketAddress sa, out int error);
// Token: 0x06001045 RID: 4165 RVA: 0x0002EE18 File Offset: 0x0002D018
private static void Connect_internal(IntPtr sock, SocketAddress sa, out int error)
{
Socket.Connect_internal(sock, sa, out error, true);
}
// Token: 0x06001046 RID: 4166 RVA: 0x0002EE24 File Offset: 0x0002D024
private static void Connect_internal(IntPtr sock, SocketAddress sa, out int error, bool requireSocketPolicyFile)
{
if (requireSocketPolicyFile && !Socket.CheckEndPoint(sa))
{
throw new SecurityException("Unable to connect, as no valid crossdomain policy was found");
}
Socket.Connect_internal_real(sock, sa, out error);
}
// Token: 0x06001047 RID: 4167 RVA: 0x0002EE58 File Offset: 0x0002D058
internal static bool CheckEndPoint(SocketAddress sa)
{
if (!Environment.SocketSecurityEnabled)
{
return true;
}
bool flag;
try
{
IPEndPoint ipendPoint = new IPEndPoint(IPAddress.Loopback, 123);
IPEndPoint ipendPoint2 = (IPEndPoint)ipendPoint.Create(sa);
if (Socket.check_socket_policy == null)
{
Socket.check_socket_policy = Socket.GetUnityCrossDomainHelperMethod("CheckSocketEndPoint");
}
flag = (bool)Socket.check_socket_policy.Invoke(null, new object[]
{
ipendPoint2.Address.ToString(),
ipendPoint2.Port
});
}
catch (Exception ex)
{
Console.WriteLine("Unexpected error while trying to CheckEndPoint() : " + ex);
flag = false;
}
return flag;
}
// Token: 0x06001048 RID: 4168 RVA: 0x0002EF1C File Offset: 0x0002D11C
private static MethodInfo GetUnityCrossDomainHelperMethod(string methodname)
{
Type type = Type.GetType("UnityEngine.UnityCrossDomainHelper, CrossDomainPolicyParser, Version=1.0.0.0, Culture=neutral");
if (type == null)
{
throw new SecurityException("Cant find type UnityCrossDomainHelper");
}
MethodInfo method = type.GetMethod(methodname);
if (method == null)
{
throw new SecurityException("Cant find " + methodname);
}
return method;
}
/// Establishes a connection to a remote host.
/// An that represents the remote device.
///
/// is null.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
/// A caller higher in the call stack does not have permission for the requested operation.
/// The is ing.
///
///
///
///
///
///
///
// Token: 0x06001049 RID: 4169 RVA: 0x0002EF68 File Offset: 0x0002D168
public void Connect(EndPoint remoteEP)
{
this.Connect(remoteEP, true);
}
// Token: 0x0600104A RID: 4170 RVA: 0x0002EF74 File Offset: 0x0002D174
internal void Connect(EndPoint remoteEP, bool requireSocketPolicy)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (remoteEP == null)
{
throw new ArgumentNullException("remoteEP");
}
IPEndPoint ipendPoint = remoteEP as IPEndPoint;
if (ipendPoint != null && (ipendPoint.Address.Equals(IPAddress.Any) || ipendPoint.Address.Equals(IPAddress.IPv6Any)))
{
throw new SocketException(10049);
}
if (this.islistening)
{
throw new InvalidOperationException();
}
SocketAddress socketAddress = remoteEP.Serialize();
int num = 0;
this.blocking_thread = Thread.CurrentThread;
try
{
Socket.Connect_internal(this.socket, socketAddress, out num, requireSocketPolicy);
}
catch (ThreadAbortException)
{
if (this.disposed)
{
Thread.ResetAbort();
num = 10004;
}
}
finally
{
this.blocking_thread = null;
}
if (num != 0)
{
throw new SocketException(num);
}
this.connected = true;
this.isbound = true;
this.seed_endpoint = remoteEP;
}
/// Begins an asynchronous request to receive data from a connected object.
/// Returns true if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the parameter will not be raised and the object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.
/// The object to use for this asynchronous socket operation.
/// An argument was invalid. The or properties on the parameter must reference valid buffers. One or the other of these properties may be set, but not both at the same time.
/// A socket operation was already in progress using the object specified in the parameter.
/// Windows XP or later is required for this method.
/// The has been closed.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
// Token: 0x0600104B RID: 4171 RVA: 0x0002F0B0 File Offset: 0x0002D2B0
public bool ReceiveAsync(SocketAsyncEventArgs e)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (e.BufferList != null)
{
throw new NotSupportedException("Mono doesn't support using BufferList at this point.");
}
e.DoOperation(SocketAsyncOperation.Receive, this);
return true;
}
/// Sends data asynchronously to a connected object.
/// Returns true if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the parameter will not be raised and the object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.
/// The object to use for this asynchronous socket operation.
/// The or properties on the parameter must reference valid buffers. One or the other of these properties may be set, but not both at the same time.
/// A socket operation was already in progress using the object specified in the parameter.
/// Windows XP or later is required for this method.
/// The has been closed.
/// The is not yet connected or was not obtained via an , ,or , method.
// Token: 0x0600104C RID: 4172 RVA: 0x0002F104 File Offset: 0x0002D304
public bool SendAsync(SocketAsyncEventArgs e)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (e.Buffer == null && e.BufferList == null)
{
throw new ArgumentException("Either e.Buffer or e.BufferList must be valid buffers.");
}
e.DoOperation(SocketAsyncOperation.Send, this);
return true;
}
// Token: 0x0600104D RID: 4173
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool Poll_internal(IntPtr socket, SelectMode mode, int timeout, out int error);
// Token: 0x0600104E RID: 4174 RVA: 0x0002F164 File Offset: 0x0002D364
internal bool Poll(int time_us, SelectMode mode, out int socket_error)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (mode != SelectMode.SelectRead && mode != SelectMode.SelectWrite && mode != SelectMode.SelectError)
{
throw new NotSupportedException("'mode' parameter is not valid.");
}
int num;
bool flag = Socket.Poll_internal(this.socket, mode, time_us, out num);
if (num != 0)
{
throw new SocketException(num);
}
socket_error = (int)this.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Error);
if (mode == SelectMode.SelectWrite && flag && socket_error == 0)
{
this.connected = true;
}
return flag;
}
// Token: 0x0600104F RID: 4175
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int Receive_internal(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, out int error);
// Token: 0x06001050 RID: 4176 RVA: 0x0002F208 File Offset: 0x0002D408
internal int Receive_nochecks(byte[] buf, int offset, int size, SocketFlags flags, out SocketError error)
{
if (this.protocol_type == ProtocolType.Udp && Environment.SocketSecurityEnabled)
{
IPAddress ipaddress = IPAddress.Any;
if (this.address_family == AddressFamily.InterNetworkV6)
{
ipaddress = IPAddress.IPv6Any;
}
EndPoint endPoint = new IPEndPoint(ipaddress, 0);
int num = 0;
int num2 = this.ReceiveFrom_nochecks_exc(buf, offset, size, flags, ref endPoint, false, out num);
error = (SocketError)num;
return num2;
}
int num4;
int num3 = Socket.Receive_internal(this.socket, buf, offset, size, flags, out num4);
error = (SocketError)num4;
if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress)
{
this.connected = false;
}
else
{
this.connected = true;
}
return num3;
}
// Token: 0x06001051 RID: 4177
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void GetSocketOption_obj_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, out object obj_val, out int error);
// Token: 0x06001052 RID: 4178
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int Send_internal(IntPtr sock, byte[] buf, int offset, int count, SocketFlags flags, out int error);
// Token: 0x06001053 RID: 4179 RVA: 0x0002F2B8 File Offset: 0x0002D4B8
internal int Send_nochecks(byte[] buf, int offset, int size, SocketFlags flags, out SocketError error)
{
if (size == 0)
{
error = SocketError.Success;
return 0;
}
int num2;
int num = Socket.Send_internal(this.socket, buf, offset, size, flags, out num2);
error = (SocketError)num2;
if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress)
{
this.connected = false;
}
else
{
this.connected = true;
}
return num;
}
/// Returns the value of a specified option, represented as an object.
/// An object that represents the value of the option. When the parameter is set to the return value is an instance of the class. When is set to or , the return value is an instance of the class. When is any other value, the return value is an integer.
/// One of the values.
/// One of the values.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.-or- was set to the unsupported value .
/// The has been closed.
///
///
///
///
///
// Token: 0x06001054 RID: 4180 RVA: 0x0002F320 File Offset: 0x0002D520
public object GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
object obj;
int num;
Socket.GetSocketOption_obj_internal(this.socket, optionLevel, optionName, out obj, out num);
if (num != 0)
{
throw new SocketException(num);
}
if (optionName == SocketOptionName.Linger)
{
return (LingerOption)obj;
}
if (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)
{
return (MulticastOption)obj;
}
if (obj is int)
{
return (int)obj;
}
return obj;
}
// Token: 0x06001055 RID: 4181
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Shutdown_internal(IntPtr socket, SocketShutdown how, out int error);
/// Disables sends and receives on a .
/// One of the values that specifies the operation that will no longer be allowed.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x06001056 RID: 4182 RVA: 0x0002F3B4 File Offset: 0x0002D5B4
public void Shutdown(SocketShutdown how)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
if (!this.connected)
{
throw new SocketException(10057);
}
int num;
Socket.Shutdown_internal(this.socket, how, out num);
if (num != 0)
{
throw new SocketException(num);
}
}
// Token: 0x06001057 RID: 4183
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void SetSocketOption_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, object obj_val, byte[] byte_val, int int_val, out int error);
/// Sets the specified option to the specified integer value.
/// One of the values.
/// One of the values.
/// A value of the option.
/// An error occurred when attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x06001058 RID: 4184 RVA: 0x0002F41C File Offset: 0x0002D61C
public void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue)
{
if (this.disposed && this.closed)
{
throw new ObjectDisposedException(base.GetType().ToString());
}
int num;
Socket.SetSocketOption_internal(this.socket, optionLevel, optionName, null, null, optionValue, out num);
if (num != 0)
{
throw new SocketException(num);
}
}
// Token: 0x06001059 RID: 4185 RVA: 0x0002F470 File Offset: 0x0002D670
private void ThrowIfUpd()
{
}
// Token: 0x04000E47 RID: 3655
private Queue readQ = new Queue(2);
// Token: 0x04000E48 RID: 3656
private Queue writeQ = new Queue(2);
// Token: 0x04000E49 RID: 3657
private bool islistening;
// Token: 0x04000E4A RID: 3658
private bool useoverlappedIO;
// Token: 0x04000E4B RID: 3659
private readonly int MinListenPort = 7100;
// Token: 0x04000E4C RID: 3660
private readonly int MaxListenPort = 7150;
// Token: 0x04000E4D RID: 3661
private static int ipv4Supported = -1;
// Token: 0x04000E4E RID: 3662
private static int ipv6Supported = -1;
// Token: 0x04000E4F RID: 3663
private int linger_timeout;
// Token: 0x04000E50 RID: 3664
private IntPtr socket;
// Token: 0x04000E51 RID: 3665
private AddressFamily address_family;
// Token: 0x04000E52 RID: 3666
private SocketType socket_type;
// Token: 0x04000E53 RID: 3667
private ProtocolType protocol_type;
// Token: 0x04000E54 RID: 3668
internal bool blocking = true;
// Token: 0x04000E55 RID: 3669
private Thread blocking_thread;
// Token: 0x04000E56 RID: 3670
private bool isbound;
// Token: 0x04000E57 RID: 3671
private static int current_bind_count;
// Token: 0x04000E58 RID: 3672
private readonly int max_bind_count = 50;
// Token: 0x04000E59 RID: 3673
private bool connected;
// Token: 0x04000E5A RID: 3674
private bool closed;
// Token: 0x04000E5B RID: 3675
internal bool disposed;
// Token: 0x04000E5C RID: 3676
internal EndPoint seed_endpoint;
// Token: 0x04000E5D RID: 3677
private static MethodInfo check_socket_policy;
// Token: 0x020001E5 RID: 485
private enum SocketOperation
{
// Token: 0x04000E5F RID: 3679
Accept,
// Token: 0x04000E60 RID: 3680
Connect,
// Token: 0x04000E61 RID: 3681
Receive,
// Token: 0x04000E62 RID: 3682
ReceiveFrom,
// Token: 0x04000E63 RID: 3683
Send,
// Token: 0x04000E64 RID: 3684
SendTo,
// Token: 0x04000E65 RID: 3685
UsedInManaged1,
// Token: 0x04000E66 RID: 3686
UsedInManaged2,
// Token: 0x04000E67 RID: 3687
UsedInProcess,
// Token: 0x04000E68 RID: 3688
UsedInConsole2,
// Token: 0x04000E69 RID: 3689
Disconnect,
// Token: 0x04000E6A RID: 3690
AcceptReceive,
// Token: 0x04000E6B RID: 3691
ReceiveGeneric,
// Token: 0x04000E6C RID: 3692
SendGeneric
}
// Token: 0x020001E6 RID: 486
private struct WSABUF
{
// Token: 0x04000E6D RID: 3693
public int len;
// Token: 0x04000E6E RID: 3694
public IntPtr buf;
}
// Token: 0x020001E7 RID: 487
[StructLayout(LayoutKind.Sequential)]
private sealed class SocketAsyncResult : IAsyncResult
{
// Token: 0x0600105A RID: 4186 RVA: 0x0002F474 File Offset: 0x0002D674
public SocketAsyncResult(Socket sock, object state, AsyncCallback callback, Socket.SocketOperation operation)
{
this.Sock = sock;
this.blocking = sock.blocking;
this.handle = sock.socket;
this.state = state;
this.callback = callback;
this.operation = operation;
this.SockFlags = SocketFlags.None;
}
// Token: 0x0600105B RID: 4187 RVA: 0x0002F4C4 File Offset: 0x0002D6C4
public void CheckIfThrowDelayedException()
{
if (this.delayedException != null)
{
this.Sock.connected = false;
throw this.delayedException;
}
if (this.error != 0)
{
this.Sock.connected = false;
throw new SocketException(this.error);
}
}
// Token: 0x0600105C RID: 4188 RVA: 0x0002F514 File Offset: 0x0002D714
private void CompleteAllOnDispose(Queue queue)
{
object[] array = queue.ToArray();
queue.Clear();
foreach (Socket.SocketAsyncResult socketAsyncResult in array)
{
WaitCallback waitCallback = new WaitCallback(socketAsyncResult.CompleteDisposed);
ThreadPool.QueueUserWorkItem(waitCallback, null);
}
if (array.Length == 0)
{
this.Buffer = null;
}
}
// Token: 0x0600105D RID: 4189 RVA: 0x0002F570 File Offset: 0x0002D770
private void CompleteDisposed(object unused)
{
this.Complete();
}
// Token: 0x0600105E RID: 4190 RVA: 0x0002F578 File Offset: 0x0002D778
public void Complete()
{
if (this.operation != Socket.SocketOperation.Receive && this.Sock.disposed)
{
this.delayedException = new ObjectDisposedException(this.Sock.GetType().ToString());
}
this.IsCompleted = true;
Queue queue = null;
if (this.operation == Socket.SocketOperation.Receive || this.operation == Socket.SocketOperation.ReceiveFrom || this.operation == Socket.SocketOperation.ReceiveGeneric)
{
queue = this.Sock.readQ;
}
else if (this.operation == Socket.SocketOperation.Send || this.operation == Socket.SocketOperation.SendTo || this.operation == Socket.SocketOperation.SendGeneric)
{
queue = this.Sock.writeQ;
}
if (queue != null)
{
Socket.SocketAsyncCall socketAsyncCall = null;
Socket.SocketAsyncResult socketAsyncResult = null;
Queue queue2 = queue;
lock (queue2)
{
queue.Dequeue();
if (queue.Count > 0)
{
socketAsyncResult = (Socket.SocketAsyncResult)queue.Peek();
if (!this.Sock.disposed)
{
Socket.Worker worker = new Socket.Worker(socketAsyncResult);
socketAsyncCall = this.GetDelegate(worker, socketAsyncResult.operation);
}
else
{
this.CompleteAllOnDispose(queue);
}
}
}
if (socketAsyncCall != null)
{
socketAsyncCall.BeginInvoke(null, socketAsyncResult);
}
}
if (this.callback != null)
{
this.callback(this);
}
this.Buffer = null;
}
// Token: 0x0600105F RID: 4191 RVA: 0x0002F6E8 File Offset: 0x0002D8E8
private Socket.SocketAsyncCall GetDelegate(Socket.Worker worker, Socket.SocketOperation op)
{
switch (op)
{
case Socket.SocketOperation.Receive:
return new Socket.SocketAsyncCall(worker.Receive);
case Socket.SocketOperation.ReceiveFrom:
return new Socket.SocketAsyncCall(worker.ReceiveFrom);
case Socket.SocketOperation.Send:
return new Socket.SocketAsyncCall(worker.Send);
case Socket.SocketOperation.SendTo:
return new Socket.SocketAsyncCall(worker.SendTo);
default:
return null;
}
}
// Token: 0x06001060 RID: 4192 RVA: 0x0002F74C File Offset: 0x0002D94C
public void Complete(bool synch)
{
this.completed_sync = synch;
this.Complete();
}
// Token: 0x06001061 RID: 4193 RVA: 0x0002F75C File Offset: 0x0002D95C
public void Complete(int total)
{
this.total = total;
this.Complete();
}
// Token: 0x06001062 RID: 4194 RVA: 0x0002F76C File Offset: 0x0002D96C
public void Complete(Exception e, bool synch)
{
this.completed_sync = synch;
this.delayedException = e;
this.Complete();
}
// Token: 0x06001063 RID: 4195 RVA: 0x0002F784 File Offset: 0x0002D984
public void Complete(Exception e)
{
this.delayedException = e;
this.Complete();
}
// Token: 0x06001064 RID: 4196 RVA: 0x0002F794 File Offset: 0x0002D994
public void Complete(Socket s)
{
this.acc_socket = s;
this.Complete();
}
// Token: 0x06001065 RID: 4197 RVA: 0x0002F7A4 File Offset: 0x0002D9A4
public void Complete(Socket s, int total)
{
this.acc_socket = s;
this.total = total;
this.Complete();
}
// Token: 0x17000572 RID: 1394
// (get) Token: 0x06001066 RID: 4198 RVA: 0x0002F7BC File Offset: 0x0002D9BC
public object AsyncState
{
get
{
return this.state;
}
}
// Token: 0x17000573 RID: 1395
// (get) Token: 0x06001067 RID: 4199 RVA: 0x0002F7C4 File Offset: 0x0002D9C4
// (set) Token: 0x06001068 RID: 4200 RVA: 0x0002F824 File Offset: 0x0002DA24
public WaitHandle AsyncWaitHandle
{
get
{
lock (this)
{
if (this.waithandle == null)
{
this.waithandle = new ManualResetEvent(this.completed);
}
}
return this.waithandle;
}
set
{
this.waithandle = value;
}
}
// Token: 0x17000574 RID: 1396
// (get) Token: 0x06001069 RID: 4201 RVA: 0x0002F830 File Offset: 0x0002DA30
public bool CompletedSynchronously
{
get
{
return this.completed_sync;
}
}
// Token: 0x17000575 RID: 1397
// (get) Token: 0x0600106A RID: 4202 RVA: 0x0002F838 File Offset: 0x0002DA38
// (set) Token: 0x0600106B RID: 4203 RVA: 0x0002F840 File Offset: 0x0002DA40
public bool IsCompleted
{
get
{
return this.completed;
}
set
{
this.completed = value;
lock (this)
{
if (this.waithandle != null && value)
{
((ManualResetEvent)this.waithandle).Set();
}
}
}
}
// Token: 0x17000576 RID: 1398
// (get) Token: 0x0600106C RID: 4204 RVA: 0x0002F8A8 File Offset: 0x0002DAA8
public Socket Socket
{
get
{
return this.acc_socket;
}
}
// Token: 0x17000577 RID: 1399
// (get) Token: 0x0600106D RID: 4205 RVA: 0x0002F8B0 File Offset: 0x0002DAB0
// (set) Token: 0x0600106E RID: 4206 RVA: 0x0002F8B8 File Offset: 0x0002DAB8
public int Total
{
get
{
return this.total;
}
set
{
this.total = value;
}
}
// Token: 0x17000578 RID: 1400
// (get) Token: 0x0600106F RID: 4207 RVA: 0x0002F8C4 File Offset: 0x0002DAC4
public SocketError ErrorCode
{
get
{
SocketException ex = this.delayedException as SocketException;
if (ex != null)
{
return ex.SocketErrorCode;
}
if (this.error != 0)
{
return (SocketError)this.error;
}
return SocketError.Success;
}
}
// Token: 0x04000E6F RID: 3695
public Socket Sock;
// Token: 0x04000E70 RID: 3696
public IntPtr handle;
// Token: 0x04000E71 RID: 3697
private object state;
// Token: 0x04000E72 RID: 3698
private AsyncCallback callback;
// Token: 0x04000E73 RID: 3699
private WaitHandle waithandle;
// Token: 0x04000E74 RID: 3700
private Exception delayedException;
// Token: 0x04000E75 RID: 3701
public EndPoint EndPoint;
// Token: 0x04000E76 RID: 3702
public byte[] Buffer;
// Token: 0x04000E77 RID: 3703
public int Offset;
// Token: 0x04000E78 RID: 3704
public int Size;
// Token: 0x04000E79 RID: 3705
public SocketFlags SockFlags;
// Token: 0x04000E7A RID: 3706
public Socket AcceptSocket;
// Token: 0x04000E7B RID: 3707
public IPAddress[] Addresses;
// Token: 0x04000E7C RID: 3708
public int Port;
// Token: 0x04000E7D RID: 3709
public IList> Buffers;
// Token: 0x04000E7E RID: 3710
public bool ReuseSocket;
// Token: 0x04000E7F RID: 3711
private Socket acc_socket;
// Token: 0x04000E80 RID: 3712
private int total;
// Token: 0x04000E81 RID: 3713
private bool completed_sync;
// Token: 0x04000E82 RID: 3714
private bool completed;
// Token: 0x04000E83 RID: 3715
public bool blocking;
// Token: 0x04000E84 RID: 3716
internal int error;
// Token: 0x04000E85 RID: 3717
private Socket.SocketOperation operation;
// Token: 0x04000E86 RID: 3718
public object ares;
// Token: 0x04000E87 RID: 3719
public int EndCalled;
}
// Token: 0x020001E8 RID: 488
private sealed class Worker
{
// Token: 0x06001070 RID: 4208 RVA: 0x0002F900 File Offset: 0x0002DB00
public Worker(Socket.SocketAsyncResult ares)
: this(ares, true)
{
}
// Token: 0x06001071 RID: 4209 RVA: 0x0002F90C File Offset: 0x0002DB0C
public Worker(Socket.SocketAsyncResult ares, bool requireSocketSecurity)
{
this.result = ares;
this.requireSocketSecurity = requireSocketSecurity;
}
// Token: 0x06001072 RID: 4210 RVA: 0x0002F924 File Offset: 0x0002DB24
public void Accept()
{
Socket socket = null;
try
{
socket = this.result.Sock.Accept();
}
catch (Exception ex)
{
this.result.Complete(ex);
return;
}
this.result.Complete(socket);
}
// Token: 0x06001073 RID: 4211 RVA: 0x0002F988 File Offset: 0x0002DB88
public void AcceptReceive()
{
Socket socket = null;
try
{
if (this.result.AcceptSocket == null)
{
socket = this.result.Sock.Accept();
}
else
{
socket = this.result.AcceptSocket;
this.result.Sock.Accept(socket);
}
}
catch (Exception ex)
{
this.result.Complete(ex);
return;
}
int num = 0;
if (this.result.Size > 0)
{
try
{
SocketError socketError;
num = socket.Receive_nochecks(this.result.Buffer, this.result.Offset, this.result.Size, this.result.SockFlags, out socketError);
}
catch (Exception ex2)
{
this.result.Complete(ex2);
return;
}
}
this.result.Complete(socket, num);
}
// Token: 0x06001074 RID: 4212 RVA: 0x0002FAA0 File Offset: 0x0002DCA0
public void Connect()
{
if (this.result.EndPoint != null)
{
try
{
if (!this.result.Sock.Blocking)
{
int num;
this.result.Sock.Poll(-1, SelectMode.SelectWrite, out num);
if (num != 0)
{
this.result.Complete(new SocketException(num));
return;
}
this.result.Sock.connected = true;
}
else
{
this.result.Sock.seed_endpoint = this.result.EndPoint;
this.result.Sock.Connect(this.result.EndPoint, this.requireSocketSecurity);
this.result.Sock.connected = true;
}
}
catch (Exception ex)
{
this.result.Complete(ex);
return;
}
this.result.Complete();
}
else if (this.result.Addresses != null)
{
int num2 = 10036;
foreach (IPAddress ipaddress in this.result.Addresses)
{
IPEndPoint ipendPoint = new IPEndPoint(ipaddress, this.result.Port);
SocketAddress socketAddress = ipendPoint.Serialize();
try
{
Socket.Connect_internal(this.result.Sock.socket, socketAddress, out num2, this.requireSocketSecurity);
}
catch (Exception ex2)
{
this.result.Complete(ex2);
return;
}
if (num2 == 0)
{
this.result.Sock.connected = true;
this.result.Sock.seed_endpoint = ipendPoint;
this.result.Complete();
return;
}
if (num2 == 10036 || num2 == 10035)
{
if (!this.result.Sock.Blocking)
{
int num3;
this.result.Sock.Poll(-1, SelectMode.SelectWrite, out num3);
if (num3 == 0)
{
this.result.Sock.connected = true;
this.result.Sock.seed_endpoint = ipendPoint;
this.result.Complete();
return;
}
}
}
}
this.result.Complete(new SocketException(num2));
}
else
{
this.result.Complete(new SocketException(10049));
}
}
// Token: 0x06001075 RID: 4213 RVA: 0x0002FD44 File Offset: 0x0002DF44
public void Disconnect()
{
try
{
this.result.Sock.Disconnect(this.result.ReuseSocket);
}
catch (Exception ex)
{
this.result.Complete(ex);
return;
}
this.result.Complete();
}
// Token: 0x06001076 RID: 4214 RVA: 0x0002FDB0 File Offset: 0x0002DFB0
public void Receive()
{
this.result.Complete();
}
// Token: 0x06001077 RID: 4215 RVA: 0x0002FDC0 File Offset: 0x0002DFC0
public void ReceiveFrom()
{
int num = 0;
try
{
num = this.result.Sock.ReceiveFrom_nochecks(this.result.Buffer, this.result.Offset, this.result.Size, this.result.SockFlags, ref this.result.EndPoint);
}
catch (Exception ex)
{
this.result.Complete(ex);
return;
}
this.result.Complete(num);
}
// Token: 0x06001078 RID: 4216 RVA: 0x0002FE5C File Offset: 0x0002E05C
public void ReceiveGeneric()
{
int num = 0;
try
{
SocketError socketError;
num = this.result.Sock.Receive(this.result.Buffers, this.result.SockFlags, out socketError);
}
catch (Exception ex)
{
this.result.Complete(ex);
return;
}
this.result.Complete(num);
}
// Token: 0x06001079 RID: 4217 RVA: 0x0002FED8 File Offset: 0x0002E0D8
private void UpdateSendValues(int last_sent)
{
if (this.result.error == 0)
{
this.send_so_far += last_sent;
this.result.Offset += last_sent;
this.result.Size -= last_sent;
}
}
// Token: 0x0600107A RID: 4218 RVA: 0x0002FF2C File Offset: 0x0002E12C
public void Send()
{
if (this.result.error == 0)
{
this.UpdateSendValues(this.result.Total);
if (this.result.Sock.disposed)
{
this.result.Complete();
return;
}
if (this.result.Size > 0)
{
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(this.Send);
socketAsyncCall.BeginInvoke(null, this.result);
return;
}
this.result.Total = this.send_so_far;
}
this.result.Complete();
}
// Token: 0x0600107B RID: 4219 RVA: 0x0002FFC4 File Offset: 0x0002E1C4
public void SendTo()
{
try
{
int num = this.result.Sock.SendTo_nochecks(this.result.Buffer, this.result.Offset, this.result.Size, this.result.SockFlags, this.result.EndPoint);
this.UpdateSendValues(num);
if (this.result.Size > 0)
{
Socket.SocketAsyncCall socketAsyncCall = new Socket.SocketAsyncCall(this.SendTo);
socketAsyncCall.BeginInvoke(null, this.result);
return;
}
this.result.Total = this.send_so_far;
}
catch (Exception ex)
{
this.result.Complete(ex);
return;
}
this.result.Complete();
}
// Token: 0x0600107C RID: 4220 RVA: 0x000300A8 File Offset: 0x0002E2A8
public void SendGeneric()
{
int num = 0;
try
{
SocketError socketError;
num = this.result.Sock.Send(this.result.Buffers, this.result.SockFlags, out socketError);
}
catch (Exception ex)
{
this.result.Complete(ex);
return;
}
this.result.Complete(num);
}
// Token: 0x04000E88 RID: 3720
private Socket.SocketAsyncResult result;
// Token: 0x04000E89 RID: 3721
private bool requireSocketSecurity;
// Token: 0x04000E8A RID: 3722
private int send_so_far;
}
// Token: 0x020001E9 RID: 489
private sealed class SendFileAsyncResult : IAsyncResult
{
// Token: 0x0600107D RID: 4221 RVA: 0x00030124 File Offset: 0x0002E324
public SendFileAsyncResult(Socket.SendFileHandler d, IAsyncResult ares)
{
this.d = d;
this.ares = ares;
}
// Token: 0x17000579 RID: 1401
// (get) Token: 0x0600107E RID: 4222 RVA: 0x0003013C File Offset: 0x0002E33C
public object AsyncState
{
get
{
return this.ares.AsyncState;
}
}
// Token: 0x1700057A RID: 1402
// (get) Token: 0x0600107F RID: 4223 RVA: 0x0003014C File Offset: 0x0002E34C
public WaitHandle AsyncWaitHandle
{
get
{
return this.ares.AsyncWaitHandle;
}
}
// Token: 0x1700057B RID: 1403
// (get) Token: 0x06001080 RID: 4224 RVA: 0x0003015C File Offset: 0x0002E35C
public bool CompletedSynchronously
{
get
{
return this.ares.CompletedSynchronously;
}
}
// Token: 0x1700057C RID: 1404
// (get) Token: 0x06001081 RID: 4225 RVA: 0x0003016C File Offset: 0x0002E36C
public bool IsCompleted
{
get
{
return this.ares.IsCompleted;
}
}
// Token: 0x1700057D RID: 1405
// (get) Token: 0x06001082 RID: 4226 RVA: 0x0003017C File Offset: 0x0002E37C
public Socket.SendFileHandler Delegate
{
get
{
return this.d;
}
}
// Token: 0x1700057E RID: 1406
// (get) Token: 0x06001083 RID: 4227 RVA: 0x00030184 File Offset: 0x0002E384
public IAsyncResult Original
{
get
{
return this.ares;
}
}
// Token: 0x04000E8B RID: 3723
private IAsyncResult ares;
// Token: 0x04000E8C RID: 3724
private Socket.SendFileHandler d;
}
// Token: 0x0200030E RID: 782
// (Invoke) Token: 0x06001C11 RID: 7185
private delegate void SocketAsyncCall();
// Token: 0x0200030F RID: 783
// (Invoke) Token: 0x06001C15 RID: 7189
private delegate void SendFileHandler(string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags);
}
}