scripts
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Specifies the addressing scheme that an instance of the <see cref="T:System.Net.Sockets.Socket" /> class can use.</summary>
|
||||
// Token: 0x020001D8 RID: 472
|
||||
public enum AddressFamily
|
||||
{
|
||||
/// <summary>Unknown address family.</summary>
|
||||
// Token: 0x04000DB2 RID: 3506
|
||||
Unknown = -1,
|
||||
/// <summary>Unspecified address family.</summary>
|
||||
// Token: 0x04000DB3 RID: 3507
|
||||
Unspecified,
|
||||
/// <summary>Unix local to host address.</summary>
|
||||
// Token: 0x04000DB4 RID: 3508
|
||||
Unix,
|
||||
/// <summary>Address for IP version 4.</summary>
|
||||
// Token: 0x04000DB5 RID: 3509
|
||||
InterNetwork,
|
||||
/// <summary>ARPANET IMP address.</summary>
|
||||
// Token: 0x04000DB6 RID: 3510
|
||||
ImpLink,
|
||||
/// <summary>Address for PUP protocols.</summary>
|
||||
// Token: 0x04000DB7 RID: 3511
|
||||
Pup,
|
||||
/// <summary>Address for MIT CHAOS protocols.</summary>
|
||||
// Token: 0x04000DB8 RID: 3512
|
||||
Chaos,
|
||||
/// <summary>Address for Xerox NS protocols.</summary>
|
||||
// Token: 0x04000DB9 RID: 3513
|
||||
NS,
|
||||
/// <summary>IPX or SPX address.</summary>
|
||||
// Token: 0x04000DBA RID: 3514
|
||||
Ipx = 6,
|
||||
/// <summary>Address for ISO protocols.</summary>
|
||||
// Token: 0x04000DBB RID: 3515
|
||||
Iso,
|
||||
/// <summary>Address for OSI protocols.</summary>
|
||||
// Token: 0x04000DBC RID: 3516
|
||||
Osi = 7,
|
||||
/// <summary>European Computer Manufacturers Association (ECMA) address.</summary>
|
||||
// Token: 0x04000DBD RID: 3517
|
||||
Ecma,
|
||||
/// <summary>Address for Datakit protocols.</summary>
|
||||
// Token: 0x04000DBE RID: 3518
|
||||
DataKit,
|
||||
/// <summary>Addresses for CCITT protocols, such as X.25.</summary>
|
||||
// Token: 0x04000DBF RID: 3519
|
||||
Ccitt,
|
||||
/// <summary>IBM SNA address.</summary>
|
||||
// Token: 0x04000DC0 RID: 3520
|
||||
Sna,
|
||||
/// <summary>DECnet address.</summary>
|
||||
// Token: 0x04000DC1 RID: 3521
|
||||
DecNet,
|
||||
/// <summary>Direct data-link interface address.</summary>
|
||||
// Token: 0x04000DC2 RID: 3522
|
||||
DataLink,
|
||||
/// <summary>LAT address.</summary>
|
||||
// Token: 0x04000DC3 RID: 3523
|
||||
Lat,
|
||||
/// <summary>NSC Hyperchannel address.</summary>
|
||||
// Token: 0x04000DC4 RID: 3524
|
||||
HyperChannel,
|
||||
/// <summary>AppleTalk address.</summary>
|
||||
// Token: 0x04000DC5 RID: 3525
|
||||
AppleTalk,
|
||||
/// <summary>NetBios address.</summary>
|
||||
// Token: 0x04000DC6 RID: 3526
|
||||
NetBios,
|
||||
/// <summary>VoiceView address.</summary>
|
||||
// Token: 0x04000DC7 RID: 3527
|
||||
VoiceView,
|
||||
/// <summary>FireFox address.</summary>
|
||||
// Token: 0x04000DC8 RID: 3528
|
||||
FireFox,
|
||||
/// <summary>Banyan address.</summary>
|
||||
// Token: 0x04000DC9 RID: 3529
|
||||
Banyan = 21,
|
||||
/// <summary>Native ATM services address.</summary>
|
||||
// Token: 0x04000DCA RID: 3530
|
||||
Atm,
|
||||
/// <summary>Address for IP version 6.</summary>
|
||||
// Token: 0x04000DCB RID: 3531
|
||||
InterNetworkV6,
|
||||
/// <summary>Address for Microsoft cluster products.</summary>
|
||||
// Token: 0x04000DCC RID: 3532
|
||||
Cluster,
|
||||
/// <summary>IEEE 1284.4 workgroup address.</summary>
|
||||
// Token: 0x04000DCD RID: 3533
|
||||
Ieee12844,
|
||||
/// <summary>IrDA address.</summary>
|
||||
// Token: 0x04000DCE RID: 3534
|
||||
Irda,
|
||||
/// <summary>Address for Network Designers OSI gateway-enabled protocols.</summary>
|
||||
// Token: 0x04000DCF RID: 3535
|
||||
NetworkDesigners = 28,
|
||||
/// <summary>MAX address.</summary>
|
||||
// Token: 0x04000DD0 RID: 3536
|
||||
Max
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Specifies the IO control codes supported by the <see cref="M:System.Net.Sockets.Socket.IOControl(System.Int32,System.Byte[],System.Byte[])" /> method.</summary>
|
||||
// Token: 0x020001D9 RID: 473
|
||||
public enum IOControlCode : long
|
||||
{
|
||||
/// <summary>This value is equal to the Winsock 2 SIO_ABSORB_RTRALERT constant.</summary>
|
||||
// Token: 0x04000DD2 RID: 3538
|
||||
AbsorbRouterAlert = 2550136837L,
|
||||
/// <summary>Join a multicast group using an interface identified by its index. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_ADD_MCAST constant.</summary>
|
||||
// Token: 0x04000DD3 RID: 3539
|
||||
AddMulticastGroupOnInterface = 2550136842L,
|
||||
/// <summary>Enable receiving notification when the list of local interfaces for the socket's protocol family changes. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_ADDRESS_LIST_CHANGE constant.</summary>
|
||||
// Token: 0x04000DD4 RID: 3540
|
||||
AddressListChange = 671088663L,
|
||||
/// <summary>Return the list of local interfaces that the socket can bind to. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_ADDRESS_LIST_QUERY constant.</summary>
|
||||
// Token: 0x04000DD5 RID: 3541
|
||||
AddressListQuery = 1207959574L,
|
||||
/// <summary>Sort the structure returned by the <see cref="F:System.Net.Sockets.IOControlCode.AddressListQuery" /> field and add scope ID information for IPv6 addresses. This control code is supported on Windows XP and later operating systems. This value is equal to the Winsock 2 SIO_ADDRESS_LIST_SORT constant.</summary>
|
||||
// Token: 0x04000DD6 RID: 3542
|
||||
AddressListSort = 3355443225L,
|
||||
/// <summary>Associate this socket with the specified handle of a companion interface. Refer to the appropriate protocol-specific annex in the Winsock 2 reference or documentation for the particular companion interface for additional details. It is recommended that the Component Object Model (COM) be used instead of this IOCTL to discover and track other interfaces that might be supported by a socket. This control code is present for backward compatibility with systems where COM is not available or cannot be used for some other reason. This value is equal to the Winsock 2 SIO_ASSOCIATE_HANDLE constant. </summary>
|
||||
// Token: 0x04000DD7 RID: 3543
|
||||
AssociateHandle = 2281701377L,
|
||||
/// <summary>Enable notification for when data is waiting to be received. This value is equal to the Winsock 2 FIOASYNC constant.</summary>
|
||||
// Token: 0x04000DD8 RID: 3544
|
||||
AsyncIO = 2147772029L,
|
||||
/// <summary>Bind the socket to a specified interface index. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_BIND constant.</summary>
|
||||
// Token: 0x04000DD9 RID: 3545
|
||||
BindToInterface = 2550136840L,
|
||||
/// <summary>Return the number of bytes available for reading. This value is equal to the Winsock 2 FIONREAD constant.</summary>
|
||||
// Token: 0x04000DDA RID: 3546
|
||||
DataToRead = 1074030207L,
|
||||
/// <summary>Remove the socket from a multicast group. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_ADD_MCAST constant.</summary>
|
||||
// Token: 0x04000DDB RID: 3547
|
||||
DeleteMulticastGroupFromInterface = 2550136843L,
|
||||
/// <summary>Replace the oldest queued datagram with an incoming datagram when the incoming message queues are full. This value is equal to the Winsock 2 SIO_ENABLE_CIRCULAR_QUEUEING constant.</summary>
|
||||
// Token: 0x04000DDC RID: 3548
|
||||
EnableCircularQueuing = 671088642L,
|
||||
/// <summary>Discard the contents of the sending queue. This value is equal to the Winsock 2 SIO_FLUSH constant.</summary>
|
||||
// Token: 0x04000DDD RID: 3549
|
||||
Flush = 671088644L,
|
||||
/// <summary>Return a SOCKADDR structure that contains the broadcast address for the address family of the current socket. The returned address can be used with the <see cref="Overload:System.Net.Sockets.Socket.SendTo" /> method. This value is equal to the Winsock 2 SIO_GET_BROADCAST_ADDRESS constant. This value can be used on User Datagram Protocol (UDP) sockets only.</summary>
|
||||
// Token: 0x04000DDE RID: 3550
|
||||
GetBroadcastAddress = 1207959557L,
|
||||
/// <summary>Obtain provider-specific functions that are not part of the Winsock specification. Functions are specified using their provider-assigned GUID. This value is equal to the Winsock 2 SIO_GET_EXTENSION_FUNCTION_POINTER constant.</summary>
|
||||
// Token: 0x04000DDF RID: 3551
|
||||
GetExtensionFunctionPointer = 3355443206L,
|
||||
/// <summary>Return the Quality of Service (QOS) attributes for the socket group. This value is reserved for future use, and is equal to the Winsock 2 SIO_GET_GROUP_QOS constant. </summary>
|
||||
// Token: 0x04000DE0 RID: 3552
|
||||
GetGroupQos = 3355443208L,
|
||||
/// <summary>Retrieve the QOS structure associated with the socket. This control is only supported on platforms that provide a QOS capable transport (Windows Me, Windows 2000, and later.) This value is equal to the Winsock 2 SIO_GET_QOS constant.</summary>
|
||||
// Token: 0x04000DE1 RID: 3553
|
||||
GetQos = 3355443207L,
|
||||
/// <summary>Control sending TCP keep-alive packets and the interval at which they are sent. This control code is supported on Windows 2000 and later operating systems. For additional information, see RFC 1122 section 4.2.3.6. This value is equal to the Winsock 2 SIO_KEEPALIVE_VALS constant.</summary>
|
||||
// Token: 0x04000DE2 RID: 3554
|
||||
KeepAliveValues = 2550136836L,
|
||||
/// <summary>This value is equal to the Winsock 2 SIO_LIMIT_BROADCASTS constant.</summary>
|
||||
// Token: 0x04000DE3 RID: 3555
|
||||
LimitBroadcasts = 2550136839L,
|
||||
/// <summary>Set the interface used for outgoing multicast packets. The interface is identified by its index. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_MCASTIF constant.</summary>
|
||||
// Token: 0x04000DE4 RID: 3556
|
||||
MulticastInterface = 2550136841L,
|
||||
/// <summary>Control the number of times a multicast packet can be forwarded by a router, also known as the Time to Live (TTL), or hop count. This value is equal to the Winsock 2 SIO_MULTICAST_SCOPE constant.</summary>
|
||||
// Token: 0x04000DE5 RID: 3557
|
||||
MulticastScope = 2281701386L,
|
||||
/// <summary>Control whether multicast data sent by the socket appears as incoming data in the sockets receive queue. This value is equal to the Winsock 2 SIO_MULTIPOINT_LOOPBACK constant.</summary>
|
||||
// Token: 0x04000DE6 RID: 3558
|
||||
MultipointLoopback = 2281701385L,
|
||||
/// <summary>Control whether the socket receives notification when a namespace query becomes invalid. This control code is supported on Windows XP and later operating systems. This value is equal to the Winsock 2 SIO_NSP_NOTIFY_CHANGE constant.</summary>
|
||||
// Token: 0x04000DE7 RID: 3559
|
||||
NamespaceChange = 2281701401L,
|
||||
/// <summary>Control the blocking behavior of the socket. If the argument specified with this control code is zero, the socket is placed in blocking mode. If the argument is nonzero, the socket is placed in nonblocking mode. This value is equal to the Winsock 2 FIONBIO constant.</summary>
|
||||
// Token: 0x04000DE8 RID: 3560
|
||||
NonBlockingIO = 2147772030L,
|
||||
/// <summary>Return information about out-of-band data waiting to be received. When using this control code on stream sockets, the return value indicates the number of bytes available.</summary>
|
||||
// Token: 0x04000DE9 RID: 3561
|
||||
OobDataRead = 1074033415L,
|
||||
/// <summary>Retrieve the underlying provider's SOCKET handle. This handle can be used to receive plug-and-play event notification. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_QUERY_TARGET_PNP_HANDLE constant.</summary>
|
||||
// Token: 0x04000DEA RID: 3562
|
||||
QueryTargetPnpHandle = 1207959576L,
|
||||
/// <summary>Enable receiving all IPv4 packets on the network. The socket must have address family <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" />, the socket type must be <see cref="F:System.Net.Sockets.SocketType.Raw" />, and the protocol type must be <see cref="F:System.Net.Sockets.ProtocolType.IP" />. The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_RCVALL constant.</summary>
|
||||
// Token: 0x04000DEB RID: 3563
|
||||
ReceiveAll = 2550136833L,
|
||||
/// <summary>Enable receiving all Internet Group Management Protocol (IGMP) packets on the network. The socket must have address family <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" />, the socket type must be <see cref="F:System.Net.Sockets.SocketType.Raw" />, and the protocol type must be <see cref="F:System.Net.Sockets.ProtocolType.Igmp" />. The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_RCVALL_IGMPMCAST constant.</summary>
|
||||
// Token: 0x04000DEC RID: 3564
|
||||
ReceiveAllIgmpMulticast = 2550136835L,
|
||||
/// <summary>Enable receiving all multicast IPv4 packets on the network. These are packets with destination addresses in the range 224.0.0.0 through 239.255.255.255. The socket must have address family <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" />, the socket type must be <see cref="F:System.Net.Sockets.SocketType.Raw" />, and the protocol type must be <see cref="F:System.Net.Sockets.ProtocolType.Udp" />. The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_RCVALL_MCAST constant.</summary>
|
||||
// Token: 0x04000DED RID: 3565
|
||||
ReceiveAllMulticast = 2550136834L,
|
||||
/// <summary>Enable receiving notification when the local interface used to access a remote endpoint changes. This value is equal to the Winsock 2 SIO_ROUTING_INTERFACE_CHANGE constant.</summary>
|
||||
// Token: 0x04000DEE RID: 3566
|
||||
RoutingInterfaceChange = 2281701397L,
|
||||
/// <summary>Return the interface addresses that can be used to connect to the specified remote address. This value is equal to the Winsock 2 SIO_ROUTING_INTERFACE_QUERY constant.</summary>
|
||||
// Token: 0x04000DEF RID: 3567
|
||||
RoutingInterfaceQuery = 3355443220L,
|
||||
/// <summary>Set the Quality of Service (QOS) attributes for the socket group. This value is reserved for future use and is equal to the Winsock 2 SIO_SET_GROUP_QOS constant.</summary>
|
||||
// Token: 0x04000DF0 RID: 3568
|
||||
SetGroupQos = 2281701388L,
|
||||
/// <summary>Set the Quality of Service (QOS) attributes for the socket. QOS defines the bandwidth requirements for the socket. This control code is supported on Windows Me, Windows 2000, and later operating systems. This value is equal to the Winsock 2 SIO_SET_QOS constant.</summary>
|
||||
// Token: 0x04000DF1 RID: 3569
|
||||
SetQos = 2281701387L,
|
||||
/// <summary>Return a handle for the socket that is valid in the context of a companion interface. This value is equal to the Winsock 2 SIO_TRANSLATE_HANDLE constant.</summary>
|
||||
// Token: 0x04000DF2 RID: 3570
|
||||
TranslateHandle = 3355443213L,
|
||||
/// <summary>Set the interface used for outgoing unicast packets. This value is equal to the Winsock 2 SIO_UCAST_IF constant.</summary>
|
||||
// Token: 0x04000DF3 RID: 3571
|
||||
UnicastInterface = 2550136838L
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Presents the packet information from a call to <see cref="M:System.Net.Sockets.Socket.ReceiveMessageFrom(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags@,System.Net.EndPoint@,System.Net.Sockets.IPPacketInformation@)" /> or <see cref="M:System.Net.Sockets.Socket.EndReceiveMessageFrom(System.IAsyncResult,System.Net.Sockets.SocketFlags@,System.Net.EndPoint@,System.Net.Sockets.IPPacketInformation@)" />.</summary>
|
||||
// Token: 0x020001DA RID: 474
|
||||
public struct IPPacketInformation
|
||||
{
|
||||
// Token: 0x06000F53 RID: 3923 RVA: 0x0002A268 File Offset: 0x00028468
|
||||
internal IPPacketInformation(IPAddress address, int iface)
|
||||
{
|
||||
this.address = address;
|
||||
this.iface = iface;
|
||||
}
|
||||
|
||||
/// <summary>Gets the origin information of the packet that was received as a result of calling the <see cref="M:System.Net.Sockets.Socket.ReceiveMessageFrom(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags@,System.Net.EndPoint@,System.Net.Sockets.IPPacketInformation@)" /> method or <see cref="M:System.Net.Sockets.Socket.EndReceiveMessageFrom(System.IAsyncResult,System.Net.Sockets.SocketFlags@,System.Net.EndPoint@,System.Net.Sockets.IPPacketInformation@)" /> method.</summary>
|
||||
/// <returns>An <see cref="T:System.Net.IPAddress" /> that indicates the origin information of the packet that was received as a result of calling the <see cref="M:System.Net.Sockets.Socket.ReceiveMessageFrom(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags@,System.Net.EndPoint@,System.Net.Sockets.IPPacketInformation@)" /> method or <see cref="M:System.Net.Sockets.Socket.EndReceiveMessageFrom(System.IAsyncResult,System.Net.Sockets.SocketFlags@,System.Net.EndPoint@,System.Net.Sockets.IPPacketInformation@)" /> method. For packets that were sent from a unicast address, the <see cref="P:System.Net.Sockets.IPPacketInformation.Address" /> property will return the <see cref="T:System.Net.IPAddress" /> of the sender; for multicast or broadcast packets, the <see cref="P:System.Net.Sockets.IPPacketInformation.Address" /> property will return the multicast or broadcast <see cref="T:System.Net.IPAddress" />.</returns>
|
||||
// Token: 0x1700053E RID: 1342
|
||||
// (get) Token: 0x06000F54 RID: 3924 RVA: 0x0002A278 File Offset: 0x00028478
|
||||
public IPAddress Address
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.address;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the network interface information that is associated with a call to <see cref="M:System.Net.Sockets.Socket.ReceiveMessageFrom(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags@,System.Net.EndPoint@,System.Net.Sockets.IPPacketInformation@)" /> or <see cref="M:System.Net.Sockets.Socket.EndReceiveMessageFrom(System.IAsyncResult,System.Net.Sockets.SocketFlags@,System.Net.EndPoint@,System.Net.Sockets.IPPacketInformation@)" />.</summary>
|
||||
/// <returns>An <see cref="T:System.Int32" /> value, which represents the index of the network interface. You can use this index with <see cref="M:System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces" /> to get more information about the relevant interface.</returns>
|
||||
// Token: 0x1700053F RID: 1343
|
||||
// (get) Token: 0x06000F55 RID: 3925 RVA: 0x0002A280 File Offset: 0x00028480
|
||||
public int Interface
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.iface;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns a value that indicates whether this instance is equal to a specified object.</summary>
|
||||
/// <returns>true if <paramref name="comparand" /> is an instance of <see cref="T:System.Net.Sockets.IPPacketInformation" /> and equals the value of the instance; otherwise, false.</returns>
|
||||
/// <param name="comparand">The object to compare with this instance.</param>
|
||||
// Token: 0x06000F56 RID: 3926 RVA: 0x0002A288 File Offset: 0x00028488
|
||||
public override bool Equals(object comparand)
|
||||
{
|
||||
if (!(comparand is IPPacketInformation))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
IPPacketInformation ippacketInformation = (IPPacketInformation)comparand;
|
||||
return ippacketInformation.iface == this.iface && ippacketInformation.address.Equals(this.address);
|
||||
}
|
||||
|
||||
/// <summary>Returns the hash code for this instance.</summary>
|
||||
/// <returns>An Int32 hash code.</returns>
|
||||
// Token: 0x06000F57 RID: 3927 RVA: 0x0002A2D0 File Offset: 0x000284D0
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return this.address.GetHashCode() + this.iface;
|
||||
}
|
||||
|
||||
/// <summary>Tests whether two specified <see cref="T:System.Net.Sockets.IPPacketInformation" /> instances are equivalent.</summary>
|
||||
/// <returns>true if <paramref name="packetInformation1" /> and <paramref name="packetInformation2" /> are equal; otherwise, false.</returns>
|
||||
/// <param name="packetInformation1">The <see cref="T:System.Net.Sockets.IPPacketInformation" /> instance that is to the left of the equality operator.</param>
|
||||
/// <param name="packetInformation2">The <see cref="T:System.Net.Sockets.IPPacketInformation" /> instance that is to the right of the equality operator.</param>
|
||||
// Token: 0x06000F58 RID: 3928 RVA: 0x0002A2E4 File Offset: 0x000284E4
|
||||
public static bool operator ==(IPPacketInformation p1, IPPacketInformation p2)
|
||||
{
|
||||
return p1.Equals(p2);
|
||||
}
|
||||
|
||||
/// <summary>Tests whether two specified <see cref="T:System.Net.Sockets.IPPacketInformation" /> instances are not equal.</summary>
|
||||
/// <returns>true if <paramref name="packetInformation1" /> and <paramref name="packetInformation2" /> are unequal; otherwise, false.</returns>
|
||||
/// <param name="packetInformation1">The <see cref="T:System.Net.Sockets.IPPacketInformation" /> instance that is to the left of the inequality operator.</param>
|
||||
/// <param name="packetInformation2">The <see cref="T:System.Net.Sockets.IPPacketInformation" /> instance that is to the right of the inequality operator.</param>
|
||||
// Token: 0x06000F59 RID: 3929 RVA: 0x0002A2F4 File Offset: 0x000284F4
|
||||
public static bool operator !=(IPPacketInformation p1, IPPacketInformation p2)
|
||||
{
|
||||
return !p1.Equals(p2);
|
||||
}
|
||||
|
||||
// Token: 0x04000DF4 RID: 3572
|
||||
private IPAddress address;
|
||||
|
||||
// Token: 0x04000DF5 RID: 3573
|
||||
private int iface;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Contains option values for joining an IPv6 multicast group.</summary>
|
||||
// Token: 0x020001DB RID: 475
|
||||
public class IPv6MulticastOption
|
||||
{
|
||||
/// <summary>Initializes a new version of the <see cref="T:System.Net.Sockets.IPv6MulticastOption" /> class for the specified IP multicast group.</summary>
|
||||
/// <param name="group">The <see cref="T:System.Net.IPAddress" /> of the multicast group. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="group" /> is null. </exception>
|
||||
// Token: 0x06000F5A RID: 3930 RVA: 0x0002A308 File Offset: 0x00028508
|
||||
public IPv6MulticastOption(IPAddress group)
|
||||
: this(group, 0L)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.IPv6MulticastOption" /> class with the specified IP multicast group and the local interface address.</summary>
|
||||
/// <param name="group">The group <see cref="T:System.Net.IPAddress" />. </param>
|
||||
/// <param name="ifindex">The local interface address. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="ifindex" /> is less than 0.-or- <paramref name="ifindex" /> is greater than 0x00000000FFFFFFFF. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="group" /> is null. </exception>
|
||||
// Token: 0x06000F5B RID: 3931 RVA: 0x0002A314 File Offset: 0x00028514
|
||||
public IPv6MulticastOption(IPAddress group, long ifindex)
|
||||
{
|
||||
if (group == null)
|
||||
{
|
||||
throw new ArgumentNullException("group");
|
||||
}
|
||||
if (ifindex < 0L || ifindex > (long)((ulong)(-1)))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("ifindex");
|
||||
}
|
||||
this.group = group;
|
||||
this.ifIndex = ifindex;
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the IP address of a multicast group.</summary>
|
||||
/// <returns>An <see cref="T:System.Net.IPAddress" /> that contains the Internet address of a multicast group.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="group" /> is null. </exception>
|
||||
// Token: 0x17000540 RID: 1344
|
||||
// (get) Token: 0x06000F5C RID: 3932 RVA: 0x0002A364 File Offset: 0x00028564
|
||||
// (set) Token: 0x06000F5D RID: 3933 RVA: 0x0002A36C File Offset: 0x0002856C
|
||||
public IPAddress Group
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.group;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
this.group = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the interface index that is associated with a multicast group.</summary>
|
||||
/// <returns>A <see cref="T:System.UInt64" /> value that specifies the address of the interface.</returns>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The value that is specified for a set operation is less than 0 or greater than 0x00000000FFFFFFFF. </exception>
|
||||
// Token: 0x17000541 RID: 1345
|
||||
// (get) Token: 0x06000F5E RID: 3934 RVA: 0x0002A388 File Offset: 0x00028588
|
||||
// (set) Token: 0x06000F5F RID: 3935 RVA: 0x0002A390 File Offset: 0x00028590
|
||||
public long InterfaceIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ifIndex;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value < 0L || value > (long)((ulong)(-1)))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value");
|
||||
}
|
||||
this.ifIndex = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000DF6 RID: 3574
|
||||
private IPAddress group;
|
||||
|
||||
// Token: 0x04000DF7 RID: 3575
|
||||
private long ifIndex;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Specifies whether a <see cref="T:System.Net.Sockets.Socket" /> will remain connected after a call to the <see cref="M:System.Net.Sockets.Socket.Close" /> or <see cref="M:System.Net.Sockets.TcpClient.Close" /> methods and the length of time it will remain connected, if data remains to be sent.</summary>
|
||||
// Token: 0x020001DC RID: 476
|
||||
public class LingerOption
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.LingerOption" /> class.</summary>
|
||||
/// <param name="enable">true to remain connected after the <see cref="M:System.Net.Sockets.Socket.Close" /> method is called; otherwise, false. </param>
|
||||
/// <param name="seconds">The number of seconds to remain connected after the <see cref="M:System.Net.Sockets.Socket.Close" /> method is called. </param>
|
||||
// Token: 0x06000F60 RID: 3936 RVA: 0x0002A3C0 File Offset: 0x000285C0
|
||||
public LingerOption(bool enable, int secs)
|
||||
{
|
||||
this.enabled = enable;
|
||||
this.seconds = secs;
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that indicates whether to linger after the <see cref="T:System.Net.Sockets.Socket" /> is closed.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.Socket" /> should linger after <see cref="M:System.Net.Sockets.Socket.Close" /> is called; otherwise, false.</returns>
|
||||
// Token: 0x17000542 RID: 1346
|
||||
// (get) Token: 0x06000F61 RID: 3937 RVA: 0x0002A3D8 File Offset: 0x000285D8
|
||||
// (set) Token: 0x06000F62 RID: 3938 RVA: 0x0002A3E0 File Offset: 0x000285E0
|
||||
public bool Enabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.enabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.enabled = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the amount of time to remain connected after calling the <see cref="M:System.Net.Sockets.Socket.Close" /> method if data remains to be sent.</summary>
|
||||
/// <returns>The amount of time, in seconds, to remain connected after calling <see cref="M:System.Net.Sockets.Socket.Close" />.</returns>
|
||||
// Token: 0x17000543 RID: 1347
|
||||
// (get) Token: 0x06000F63 RID: 3939 RVA: 0x0002A3EC File Offset: 0x000285EC
|
||||
// (set) Token: 0x06000F64 RID: 3940 RVA: 0x0002A3F4 File Offset: 0x000285F4
|
||||
public int LingerTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.seconds;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.seconds = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000DF8 RID: 3576
|
||||
private bool enabled;
|
||||
|
||||
// Token: 0x04000DF9 RID: 3577
|
||||
private int seconds;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Contains <see cref="T:System.Net.IPAddress" /> values used to join and drop multicast groups.</summary>
|
||||
// Token: 0x020001DD RID: 477
|
||||
public class MulticastOption
|
||||
{
|
||||
/// <summary>Initializes a new version of the <see cref="T:System.Net.Sockets.MulticastOption" /> class for the specified IP multicast group.</summary>
|
||||
/// <param name="group">The <see cref="T:System.Net.IPAddress" /> of the multicast group. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="group" /> is null. </exception>
|
||||
// Token: 0x06000F65 RID: 3941 RVA: 0x0002A400 File Offset: 0x00028600
|
||||
public MulticastOption(IPAddress group)
|
||||
: this(group, IPAddress.Any)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.MulticastOption" /> class with the specified IP multicast group address and interface index.</summary>
|
||||
/// <param name="group">The <see cref="T:System.Net.IPAddress" /> of the multicast group.</param>
|
||||
/// <param name="interfaceIndex">The index of the interface that is used to send and receive multicast packets.</param>
|
||||
// Token: 0x06000F66 RID: 3942 RVA: 0x0002A410 File Offset: 0x00028610
|
||||
public MulticastOption(IPAddress group, int interfaceIndex)
|
||||
{
|
||||
if (group == null)
|
||||
{
|
||||
throw new ArgumentNullException("group");
|
||||
}
|
||||
if (interfaceIndex < 0 || interfaceIndex > 16777215)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("interfaceIndex");
|
||||
}
|
||||
this.group = group;
|
||||
this.iface_index = interfaceIndex;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.MulticastOption" /> class with the specified IP multicast group address and local IP address associated with a network interface.</summary>
|
||||
/// <param name="group">The group <see cref="T:System.Net.IPAddress" />. </param>
|
||||
/// <param name="mcint">The local <see cref="T:System.Net.IPAddress" />. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="group" /> is null.-or- <paramref name="mcint" /> is null. </exception>
|
||||
// Token: 0x06000F67 RID: 3943 RVA: 0x0002A460 File Offset: 0x00028660
|
||||
public MulticastOption(IPAddress group, IPAddress mcint)
|
||||
{
|
||||
if (group == null)
|
||||
{
|
||||
throw new ArgumentNullException("group");
|
||||
}
|
||||
if (mcint == null)
|
||||
{
|
||||
throw new ArgumentNullException("mcint");
|
||||
}
|
||||
this.group = group;
|
||||
this.local = mcint;
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the IP address of a multicast group.</summary>
|
||||
/// <returns>An <see cref="T:System.Net.IPAddress" /> that contains the Internet address of a multicast group.</returns>
|
||||
// Token: 0x17000544 RID: 1348
|
||||
// (get) Token: 0x06000F68 RID: 3944 RVA: 0x0002A4A4 File Offset: 0x000286A4
|
||||
// (set) Token: 0x06000F69 RID: 3945 RVA: 0x0002A4AC File Offset: 0x000286AC
|
||||
public IPAddress Group
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.group;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.group = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the local address associated with a multicast group.</summary>
|
||||
/// <returns>An <see cref="T:System.Net.IPAddress" /> that contains the local address associated with a multicast group.</returns>
|
||||
// Token: 0x17000545 RID: 1349
|
||||
// (get) Token: 0x06000F6A RID: 3946 RVA: 0x0002A4B8 File Offset: 0x000286B8
|
||||
// (set) Token: 0x06000F6B RID: 3947 RVA: 0x0002A4C0 File Offset: 0x000286C0
|
||||
public IPAddress LocalAddress
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.local;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.local = value;
|
||||
this.iface_index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the index of the interface that is used to send and receive multicast packets. </summary>
|
||||
/// <returns>An integer that represents the index of a <see cref="T:System.Net.NetworkInformation.NetworkInterface" /> array element.</returns>
|
||||
// Token: 0x17000546 RID: 1350
|
||||
// (get) Token: 0x06000F6C RID: 3948 RVA: 0x0002A4D0 File Offset: 0x000286D0
|
||||
// (set) Token: 0x06000F6D RID: 3949 RVA: 0x0002A4D8 File Offset: 0x000286D8
|
||||
public int InterfaceIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.iface_index;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value < 0 || value > 16777215)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value");
|
||||
}
|
||||
this.iface_index = value;
|
||||
this.local = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000DFA RID: 3578
|
||||
private IPAddress group;
|
||||
|
||||
// Token: 0x04000DFB RID: 3579
|
||||
private IPAddress local;
|
||||
|
||||
// Token: 0x04000DFC RID: 3580
|
||||
private int iface_index;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,616 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Provides the underlying stream of data for network access.</summary>
|
||||
// Token: 0x020001DE RID: 478
|
||||
public class NetworkStream : Stream, IDisposable
|
||||
{
|
||||
/// <summary>Creates a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <param name="socket">The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="socket" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.IO.IOException">The <paramref name="socket" /> parameter is not connected.-or- The <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />.-or- The <paramref name="socket" /> parameter is in a nonblocking state. </exception>
|
||||
// Token: 0x06000F6E RID: 3950 RVA: 0x0002A508 File Offset: 0x00028708
|
||||
public NetworkStream(Socket socket)
|
||||
: this(socket, FileAccess.ReadWrite, false)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" /> with the specified <see cref="T:System.Net.Sockets.Socket" /> ownership.</summary>
|
||||
/// <param name="socket">The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. </param>
|
||||
/// <param name="ownsSocket">Set to true to indicate that the <see cref="T:System.Net.Sockets.NetworkStream" /> will take ownership of the <see cref="T:System.Net.Sockets.Socket" />; otherwise, false. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="socket" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.IO.IOException">The <paramref name="socket" /> parameter is not connected.-or- the value of the <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />.-or- the <paramref name="socket" /> parameter is in a nonblocking state. </exception>
|
||||
// Token: 0x06000F6F RID: 3951 RVA: 0x0002A514 File Offset: 0x00028714
|
||||
public NetworkStream(Socket socket, bool owns_socket)
|
||||
: this(socket, FileAccess.ReadWrite, owns_socket)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Creates a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" /> with the specified access rights.</summary>
|
||||
/// <param name="socket">The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. </param>
|
||||
/// <param name="access">A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values that specify the type of access given to the <see cref="T:System.Net.Sockets.NetworkStream" /> over the provided <see cref="T:System.Net.Sockets.Socket" />. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="socket" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.IO.IOException">The <paramref name="socket" /> parameter is not connected.-or- the <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />.-or- the <paramref name="socket" /> parameter is in a nonblocking state. </exception>
|
||||
// Token: 0x06000F70 RID: 3952 RVA: 0x0002A520 File Offset: 0x00028720
|
||||
public NetworkStream(Socket socket, FileAccess access)
|
||||
: this(socket, access, false)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Creates a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" /> with the specified access rights and the specified <see cref="T:System.Net.Sockets.Socket" /> ownership.</summary>
|
||||
/// <param name="socket">The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. </param>
|
||||
/// <param name="access">A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values that specifies the type of access given to the <see cref="T:System.Net.Sockets.NetworkStream" /> over the provided <see cref="T:System.Net.Sockets.Socket" />. </param>
|
||||
/// <param name="ownsSocket">Set to true to indicate that the <see cref="T:System.Net.Sockets.NetworkStream" /> will take ownership of the <see cref="T:System.Net.Sockets.Socket" />; otherwise, false. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="socket" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.IO.IOException">The <paramref name="socket" /> parameter is not connected.-or- The <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />.-or- The <paramref name="socket" /> parameter is in a nonblocking state. </exception>
|
||||
// Token: 0x06000F71 RID: 3953 RVA: 0x0002A52C File Offset: 0x0002872C
|
||||
public NetworkStream(Socket socket, FileAccess access, bool owns_socket)
|
||||
{
|
||||
if (socket == null)
|
||||
{
|
||||
throw new ArgumentNullException("socket is null");
|
||||
}
|
||||
if (socket.SocketType != SocketType.Stream)
|
||||
{
|
||||
throw new ArgumentException("Socket is not of type Stream", "socket");
|
||||
}
|
||||
if (!socket.Connected)
|
||||
{
|
||||
throw new IOException("Not connected");
|
||||
}
|
||||
if (!socket.Blocking)
|
||||
{
|
||||
throw new IOException("Operation not allowed on a non-blocking socket.");
|
||||
}
|
||||
this.socket = socket;
|
||||
this.owns_socket = owns_socket;
|
||||
this.access = access;
|
||||
this.readable = this.CanRead;
|
||||
this.writeable = this.CanWrite;
|
||||
}
|
||||
|
||||
/// <summary>Releases all resources used by the <see cref="T:System.Net.Sockets.NetworkStream" />.</summary>
|
||||
// Token: 0x06000F72 RID: 3954 RVA: 0x0002A5C8 File Offset: 0x000287C8
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
this.Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether the <see cref="T:System.Net.Sockets.NetworkStream" /> supports reading.</summary>
|
||||
/// <returns>true if data can be read from the stream; otherwise, false. The default value is true.</returns>
|
||||
// Token: 0x17000547 RID: 1351
|
||||
// (get) Token: 0x06000F73 RID: 3955 RVA: 0x0002A5D8 File Offset: 0x000287D8
|
||||
public override bool CanRead
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.access == FileAccess.ReadWrite || this.access == FileAccess.Read;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether the stream supports seeking. This property is not currently supported.This property always returns false.</summary>
|
||||
/// <returns>false in all cases to indicate that <see cref="T:System.Net.Sockets.NetworkStream" /> cannot seek a specific location in the stream.</returns>
|
||||
// Token: 0x17000548 RID: 1352
|
||||
// (get) Token: 0x06000F74 RID: 3956 RVA: 0x0002A5F4 File Offset: 0x000287F4
|
||||
public override bool CanSeek
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether timeout properties are usable for <see cref="T:System.Net.Sockets.NetworkStream" />.</summary>
|
||||
/// <returns>true in all cases.</returns>
|
||||
// Token: 0x17000549 RID: 1353
|
||||
// (get) Token: 0x06000F75 RID: 3957 RVA: 0x0002A5F8 File Offset: 0x000287F8
|
||||
public override bool CanTimeout
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether the <see cref="T:System.Net.Sockets.NetworkStream" /> supports writing.</summary>
|
||||
/// <returns>true if data can be written to the <see cref="T:System.Net.Sockets.NetworkStream" />; otherwise, false. The default value is true.</returns>
|
||||
// Token: 0x1700054A RID: 1354
|
||||
// (get) Token: 0x06000F76 RID: 3958 RVA: 0x0002A5FC File Offset: 0x000287FC
|
||||
public override bool CanWrite
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.access == FileAccess.ReadWrite || this.access == FileAccess.Write;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether data is available on the <see cref="T:System.Net.Sockets.NetworkStream" /> to be read.</summary>
|
||||
/// <returns>true if data is available on the stream to be read; otherwise, false.</returns>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.NetworkStream" /> is closed. </exception>
|
||||
/// <exception cref="T:System.IO.IOException">The underlying <see cref="T:System.Net.Sockets.Socket" /> is closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">Use the <see cref="P:System.Net.Sockets.SocketException.ErrorCode" /> property to obtain the specific error code, and refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x1700054B RID: 1355
|
||||
// (get) Token: 0x06000F77 RID: 3959 RVA: 0x0002A618 File Offset: 0x00028818
|
||||
public virtual bool DataAvailable
|
||||
{
|
||||
get
|
||||
{
|
||||
this.CheckDisposed();
|
||||
return this.socket.Available > 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the length of the data available on the stream. This property is not currently supported and always throws a <see cref="T:System.NotSupportedException" />.</summary>
|
||||
/// <returns>The length of the data available on the stream.</returns>
|
||||
/// <exception cref="T:System.NotSupportedException">Any use of this property. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x1700054C RID: 1356
|
||||
// (get) Token: 0x06000F78 RID: 3960 RVA: 0x0002A630 File Offset: 0x00028830
|
||||
public override long Length
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the current position in the stream. This property is not currently supported and always throws a <see cref="T:System.NotSupportedException" />.</summary>
|
||||
/// <returns>The current position in the stream.</returns>
|
||||
/// <exception cref="T:System.NotSupportedException">Any use of this property. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x1700054D RID: 1357
|
||||
// (get) Token: 0x06000F79 RID: 3961 RVA: 0x0002A638 File Offset: 0x00028838
|
||||
// (set) Token: 0x06000F7A RID: 3962 RVA: 0x0002A640 File Offset: 0x00028840
|
||||
public override long Position
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
set
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that indicates whether the <see cref="T:System.Net.Sockets.NetworkStream" /> can be read.</summary>
|
||||
/// <returns>true to indicate that the <see cref="T:System.Net.Sockets.NetworkStream" /> can be read; otherwise, false. The default value is true.</returns>
|
||||
// Token: 0x1700054E RID: 1358
|
||||
// (get) Token: 0x06000F7B RID: 3963 RVA: 0x0002A648 File Offset: 0x00028848
|
||||
// (set) Token: 0x06000F7C RID: 3964 RVA: 0x0002A650 File Offset: 0x00028850
|
||||
protected bool Readable
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.readable;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.readable = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the amount of time that a read operation blocks waiting for data. </summary>
|
||||
/// <returns>A <see cref="T:System.Int32" /> that specifies the amount of time, in milliseconds, that will elapse before a read operation fails. The default value, <see cref="F:System.Threading.Timeout.Infinite" />, specifies that the read operation does not time out.</returns>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The value specified is less than or equal to zero and is not <see cref="F:System.Threading.Timeout.Infinite" />. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x1700054F RID: 1359
|
||||
// (get) Token: 0x06000F7D RID: 3965 RVA: 0x0002A65C File Offset: 0x0002885C
|
||||
// (set) Token: 0x06000F7E RID: 3966 RVA: 0x0002A66C File Offset: 0x0002886C
|
||||
public override int ReadTimeout
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.socket.ReceiveTimeout;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value <= 0 && (float)value != NetworkStream.Timeout.Infinite)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value", "The value specified is less than or equal to zero and is not Infinite.");
|
||||
}
|
||||
this.socket.ReceiveTimeout = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the underlying <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.Socket" /> that represents the underlying network connection.</returns>
|
||||
// Token: 0x17000550 RID: 1360
|
||||
// (get) Token: 0x06000F7F RID: 3967 RVA: 0x0002A6A0 File Offset: 0x000288A0
|
||||
protected Socket Socket
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.socket;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether the <see cref="T:System.Net.Sockets.NetworkStream" /> is writable.</summary>
|
||||
/// <returns>true if data can be written to the stream; otherwise, false. The default value is true.</returns>
|
||||
// Token: 0x17000551 RID: 1361
|
||||
// (get) Token: 0x06000F80 RID: 3968 RVA: 0x0002A6A8 File Offset: 0x000288A8
|
||||
// (set) Token: 0x06000F81 RID: 3969 RVA: 0x0002A6B0 File Offset: 0x000288B0
|
||||
protected bool Writeable
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.writeable;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.writeable = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the amount of time that a write operation blocks waiting for data. </summary>
|
||||
/// <returns>A <see cref="T:System.Int32" /> that specifies the amount of time, in milliseconds, that will elapse before a write operation fails. The default value, <see cref="F:System.Threading.Timeout.Infinite" />, specifies that the write operation does not time out.</returns>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The value specified is less than or equal to zero and is not <see cref="F:System.Threading.Timeout.Infinite" />. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x17000552 RID: 1362
|
||||
// (get) Token: 0x06000F82 RID: 3970 RVA: 0x0002A6BC File Offset: 0x000288BC
|
||||
// (set) Token: 0x06000F83 RID: 3971 RVA: 0x0002A6CC File Offset: 0x000288CC
|
||||
public override int WriteTimeout
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.socket.SendTimeout;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value <= 0 && (float)value != NetworkStream.Timeout.Infinite)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value", "The value specified is less than or equal to zero and is not Infinite");
|
||||
}
|
||||
this.socket.SendTimeout = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous read from the <see cref="T:System.Net.Sockets.NetworkStream" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that represents the asynchronous call.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the location in memory to store data read from the <see cref="T:System.Net.Sockets.NetworkStream" />. </param>
|
||||
/// <param name="offset">The location in <paramref name="buffer" /> to begin storing the data. </param>
|
||||
/// <param name="size">The number of bytes to read from the <see cref="T:System.Net.Sockets.NetworkStream" />. </param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate that is executed when <see cref="M:System.Net.Sockets.NetworkStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> completes. </param>
|
||||
/// <param name="state">An object that contains any additional user-defined data. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> parameter is less than 0.-or- The <paramref name="offset" /> parameter is greater than the length of the <paramref name="buffer" /> paramater.-or- The <paramref name="size" /> is less than 0.-or- The <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter.</exception>
|
||||
/// <exception cref="T:System.IO.IOException">The underlying <see cref="T:System.Net.Sockets.Socket" /> is closed.-or- There was a failure while reading from the network. -or-An error occurred when accessing the socket. See the Remarks section for more information.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.NetworkStream" /> is closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06000F84 RID: 3972 RVA: 0x0002A700 File Offset: 0x00028900
|
||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer is null");
|
||||
}
|
||||
int num = buffer.Length;
|
||||
if (offset < 0 || offset > num)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset exceeds the size of buffer");
|
||||
}
|
||||
if (size < 0 || offset + size > num)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer");
|
||||
}
|
||||
IAsyncResult asyncResult;
|
||||
try
|
||||
{
|
||||
asyncResult = this.socket.BeginReceive(buffer, offset, size, SocketFlags.None, callback, state);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new IOException("BeginReceive failure", ex);
|
||||
}
|
||||
return asyncResult;
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous write to a stream.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that represents the asynchronous call.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to write to the <see cref="T:System.Net.Sockets.NetworkStream" />. </param>
|
||||
/// <param name="offset">The location in <paramref name="buffer" /> to begin sending the data. </param>
|
||||
/// <param name="size">The number of bytes to write to the <see cref="T:System.Net.Sockets.NetworkStream" />. </param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate that is executed when <see cref="M:System.Net.Sockets.NetworkStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> completes. </param>
|
||||
/// <param name="state">An object that contains any additional user-defined data. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> parameter is less than 0.-or- The <paramref name="offset" /> parameter is greater than the length of <paramref name="buffer" />.-or- The <paramref name="size" /> parameter is less than 0.-or- The <paramref name="size" /> parameter is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.IO.IOException">The underlying <see cref="T:System.Net.Sockets.Socket" /> is closed.-or- There was a failure while writing to the network. -or-An error occurred when accessing the socket. See the Remarks section for more information.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.NetworkStream" /> is closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06000F85 RID: 3973 RVA: 0x0002A7A4 File Offset: 0x000289A4
|
||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer is null");
|
||||
}
|
||||
int num = buffer.Length;
|
||||
if (offset < 0 || offset > num)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset exceeds the size of buffer");
|
||||
}
|
||||
if (size < 0 || offset + size > num)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer");
|
||||
}
|
||||
IAsyncResult asyncResult;
|
||||
try
|
||||
{
|
||||
asyncResult = this.socket.BeginSend(buffer, offset, size, SocketFlags.None, callback, state);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw new IOException("BeginWrite failure");
|
||||
}
|
||||
return asyncResult;
|
||||
}
|
||||
|
||||
/// <summary>Releases all resources used by the <see cref="T:System.Net.Sockets.NetworkStream" />.</summary>
|
||||
// Token: 0x06000F86 RID: 3974 RVA: 0x0002A848 File Offset: 0x00028A48
|
||||
~NetworkStream()
|
||||
{
|
||||
this.Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Net.Sockets.NetworkStream" /> and optionally releases the managed resources.</summary>
|
||||
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
|
||||
// Token: 0x06000F87 RID: 3975 RVA: 0x0002A884 File Offset: 0x00028A84
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (this.disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.disposed = true;
|
||||
if (this.owns_socket)
|
||||
{
|
||||
Socket socket = this.socket;
|
||||
if (socket != null)
|
||||
{
|
||||
socket.Close();
|
||||
}
|
||||
}
|
||||
this.socket = null;
|
||||
this.access = (FileAccess)0;
|
||||
}
|
||||
|
||||
/// <summary>Handles the end of an asynchronous read.</summary>
|
||||
/// <returns>The number of bytes read from the <see cref="T:System.Net.Sockets.NetworkStream" />.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that represents an asynchronous call. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="asyncResult" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.IO.IOException">The underlying <see cref="T:System.Net.Sockets.Socket" /> is closed.-or- An error occurred when accessing the socket. See the Remarks section for more information.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.NetworkStream" /> is closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06000F88 RID: 3976 RVA: 0x0002A8D0 File Offset: 0x00028AD0
|
||||
public override int EndRead(IAsyncResult ar)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (ar == null)
|
||||
{
|
||||
throw new ArgumentNullException("async result is null");
|
||||
}
|
||||
int num;
|
||||
try
|
||||
{
|
||||
num = this.socket.EndReceive(ar);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new IOException("EndRead failure", ex);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
/// <summary>Handles the end of an asynchronous write.</summary>
|
||||
/// <param name="asyncResult">The <see cref="T:System.IAsyncResult" /> that represents the asynchronous call. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="asyncResult" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.IO.IOException">The underlying <see cref="T:System.Net.Sockets.Socket" /> is closed.-or- An error occurred while writing to the network. -or-An error occurred when accessing the socket. See the Remarks section for more information.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.NetworkStream" /> is closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06000F89 RID: 3977 RVA: 0x0002A938 File Offset: 0x00028B38
|
||||
public override void EndWrite(IAsyncResult ar)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (ar == null)
|
||||
{
|
||||
throw new ArgumentNullException("async result is null");
|
||||
}
|
||||
try
|
||||
{
|
||||
this.socket.EndSend(ar);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new IOException("EndWrite failure", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Flushes data from the stream. This method is reserved for future use.</summary>
|
||||
// Token: 0x06000F8A RID: 3978 RVA: 0x0002A99C File Offset: 0x00028B9C
|
||||
public override void Flush()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Reads data from the <see cref="T:System.Net.Sockets.NetworkStream" />.</summary>
|
||||
/// <returns>The number of bytes read from the <see cref="T:System.Net.Sockets.NetworkStream" />.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the location in memory to store data read from the <see cref="T:System.Net.Sockets.NetworkStream" />. </param>
|
||||
/// <param name="offset">The location in <paramref name="buffer" /> to begin storing the data to. </param>
|
||||
/// <param name="size">The number of bytes to read from the <see cref="T:System.Net.Sockets.NetworkStream" />. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> parameter is less than 0.-or- The <paramref name="offset" /> parameter is greater than the length of <paramref name="buffer" />.-or- The <paramref name="size" /> parameter is less than 0.-or- The <paramref name="size" /> parameter is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. -or-An error occurred when accessing the socket. See the Remarks section for more information.</exception>
|
||||
/// <exception cref="T:System.IO.IOException">The underlying <see cref="T:System.Net.Sockets.Socket" /> is closed. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.NetworkStream" /> is closed.-or- There is a failure reading from the network. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06000F8B RID: 3979 RVA: 0x0002A9A0 File Offset: 0x00028BA0
|
||||
public override int Read([In] [Out] byte[] buffer, int offset, int size)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer is null");
|
||||
}
|
||||
if (offset < 0 || offset > buffer.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset exceeds the size of buffer");
|
||||
}
|
||||
if (size < 0 || offset + size > buffer.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer");
|
||||
}
|
||||
int num;
|
||||
try
|
||||
{
|
||||
num = this.socket.Receive(buffer, offset, size, SocketFlags.None);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new IOException("Read failure", ex);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
/// <summary>Sets the current position of the stream to the given value. This method is not currently supported and always throws a <see cref="T:System.NotSupportedException" />.</summary>
|
||||
/// <returns>The position in the stream.</returns>
|
||||
/// <param name="offset">This parameter is not used. </param>
|
||||
/// <param name="origin">This parameter is not used. </param>
|
||||
/// <exception cref="T:System.NotSupportedException">Any use of this property. </exception>
|
||||
// Token: 0x06000F8C RID: 3980 RVA: 0x0002AA40 File Offset: 0x00028C40
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>Sets the length of the stream. This method always throws a <see cref="T:System.NotSupportedException" />.</summary>
|
||||
/// <param name="value">This parameter is not used. </param>
|
||||
/// <exception cref="T:System.NotSupportedException">Any use of this property. </exception>
|
||||
// Token: 0x06000F8D RID: 3981 RVA: 0x0002AA48 File Offset: 0x00028C48
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>Writes data to the <see cref="T:System.Net.Sockets.NetworkStream" />.</summary>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to write to the <see cref="T:System.Net.Sockets.NetworkStream" />. </param>
|
||||
/// <param name="offset">The location in <paramref name="buffer" /> from which to start writing data. </param>
|
||||
/// <param name="size">The number of bytes to write to the <see cref="T:System.Net.Sockets.NetworkStream" />. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> parameter is less than 0.-or- The <paramref name="offset" /> parameter is greater than the length of <paramref name="buffer" />.-or- The <paramref name="size" /> parameter is less than 0.-or- The <paramref name="size" /> parameter is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.IO.IOException">There was a failure while writing to the network. -or-An error occurred when accessing the socket. See the Remarks section for more information.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.NetworkStream" /> is closed.-or- There was a failure reading from the network. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06000F8E RID: 3982 RVA: 0x0002AA50 File Offset: 0x00028C50
|
||||
public override void Write(byte[] buffer, int offset, int size)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
if (offset < 0 || offset > buffer.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset exceeds the size of buffer");
|
||||
}
|
||||
if (size < 0 || size > buffer.Length - offset)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer");
|
||||
}
|
||||
try
|
||||
{
|
||||
int num = 0;
|
||||
while (size - num > 0)
|
||||
{
|
||||
num += this.socket.Send(buffer, offset + num, size - num, SocketFlags.None);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new IOException("Write failure", ex);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000F8F RID: 3983 RVA: 0x0002AB08 File Offset: 0x00028D08
|
||||
private void CheckDisposed()
|
||||
{
|
||||
if (this.disposed)
|
||||
{
|
||||
throw new ObjectDisposedException(base.GetType().FullName);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000DFD RID: 3581
|
||||
private FileAccess access;
|
||||
|
||||
// Token: 0x04000DFE RID: 3582
|
||||
private Socket socket;
|
||||
|
||||
// Token: 0x04000DFF RID: 3583
|
||||
private bool owns_socket;
|
||||
|
||||
// Token: 0x04000E00 RID: 3584
|
||||
private bool readable;
|
||||
|
||||
// Token: 0x04000E01 RID: 3585
|
||||
private bool writeable;
|
||||
|
||||
// Token: 0x04000E02 RID: 3586
|
||||
private bool disposed;
|
||||
|
||||
// Token: 0x020001DF RID: 479
|
||||
public static class Timeout
|
||||
{
|
||||
// Token: 0x04000E03 RID: 3587
|
||||
public static readonly float Infinite = -1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Specifies the type of protocol that an instance of the <see cref="T:System.Net.Sockets.Socket" /> class can use.</summary>
|
||||
// Token: 0x020001E0 RID: 480
|
||||
public enum ProtocolFamily
|
||||
{
|
||||
/// <summary>Unknown protocol.</summary>
|
||||
// Token: 0x04000E05 RID: 3589
|
||||
Unknown = -1,
|
||||
/// <summary>Unspecified protocol.</summary>
|
||||
// Token: 0x04000E06 RID: 3590
|
||||
Unspecified,
|
||||
/// <summary>Unix local to host protocol.</summary>
|
||||
// Token: 0x04000E07 RID: 3591
|
||||
Unix,
|
||||
/// <summary>IP version 4 protocol.</summary>
|
||||
// Token: 0x04000E08 RID: 3592
|
||||
InterNetwork,
|
||||
/// <summary>ARPANET IMP protocol.</summary>
|
||||
// Token: 0x04000E09 RID: 3593
|
||||
ImpLink,
|
||||
/// <summary>PUP protocol.</summary>
|
||||
// Token: 0x04000E0A RID: 3594
|
||||
Pup,
|
||||
/// <summary>MIT CHAOS protocol.</summary>
|
||||
// Token: 0x04000E0B RID: 3595
|
||||
Chaos,
|
||||
/// <summary>IPX or SPX protocol.</summary>
|
||||
// Token: 0x04000E0C RID: 3596
|
||||
Ipx,
|
||||
/// <summary>ISO protocol.</summary>
|
||||
// Token: 0x04000E0D RID: 3597
|
||||
Iso,
|
||||
/// <summary>European Computer Manufacturers Association (ECMA) protocol.</summary>
|
||||
// Token: 0x04000E0E RID: 3598
|
||||
Ecma,
|
||||
/// <summary>DataKit protocol.</summary>
|
||||
// Token: 0x04000E0F RID: 3599
|
||||
DataKit,
|
||||
/// <summary>CCITT protocol, such as X.25.</summary>
|
||||
// Token: 0x04000E10 RID: 3600
|
||||
Ccitt,
|
||||
/// <summary>IBM SNA protocol.</summary>
|
||||
// Token: 0x04000E11 RID: 3601
|
||||
Sna,
|
||||
/// <summary>DECNet protocol.</summary>
|
||||
// Token: 0x04000E12 RID: 3602
|
||||
DecNet,
|
||||
/// <summary>Direct data link protocol.</summary>
|
||||
// Token: 0x04000E13 RID: 3603
|
||||
DataLink,
|
||||
/// <summary>LAT protocol.</summary>
|
||||
// Token: 0x04000E14 RID: 3604
|
||||
Lat,
|
||||
/// <summary>NSC HyperChannel protocol.</summary>
|
||||
// Token: 0x04000E15 RID: 3605
|
||||
HyperChannel,
|
||||
/// <summary>AppleTalk protocol.</summary>
|
||||
// Token: 0x04000E16 RID: 3606
|
||||
AppleTalk,
|
||||
/// <summary>NetBIOS protocol.</summary>
|
||||
// Token: 0x04000E17 RID: 3607
|
||||
NetBios,
|
||||
/// <summary>VoiceView protocol.</summary>
|
||||
// Token: 0x04000E18 RID: 3608
|
||||
VoiceView,
|
||||
/// <summary>FireFox protocol.</summary>
|
||||
// Token: 0x04000E19 RID: 3609
|
||||
FireFox,
|
||||
/// <summary>Banyan protocol.</summary>
|
||||
// Token: 0x04000E1A RID: 3610
|
||||
Banyan = 21,
|
||||
/// <summary>Native ATM services protocol.</summary>
|
||||
// Token: 0x04000E1B RID: 3611
|
||||
Atm,
|
||||
/// <summary>IP version 6 protocol.</summary>
|
||||
// Token: 0x04000E1C RID: 3612
|
||||
InterNetworkV6,
|
||||
/// <summary>Microsoft Cluster products protocol.</summary>
|
||||
// Token: 0x04000E1D RID: 3613
|
||||
Cluster,
|
||||
/// <summary>IEEE 1284.4 workgroup protocol.</summary>
|
||||
// Token: 0x04000E1E RID: 3614
|
||||
Ieee12844,
|
||||
/// <summary>IrDA protocol.</summary>
|
||||
// Token: 0x04000E1F RID: 3615
|
||||
Irda,
|
||||
/// <summary>Network Designers OSI gateway enabled protocol.</summary>
|
||||
// Token: 0x04000E20 RID: 3616
|
||||
NetworkDesigners = 28,
|
||||
/// <summary>MAX protocol.</summary>
|
||||
// Token: 0x04000E21 RID: 3617
|
||||
Max,
|
||||
/// <summary>Xerox NS protocol.</summary>
|
||||
// Token: 0x04000E22 RID: 3618
|
||||
NS = 6,
|
||||
/// <summary>OSI protocol.</summary>
|
||||
// Token: 0x04000E23 RID: 3619
|
||||
Osi
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Specifies the protocols that the <see cref="T:System.Net.Sockets.Socket" /> class supports.</summary>
|
||||
// Token: 0x020001E1 RID: 481
|
||||
public enum ProtocolType
|
||||
{
|
||||
/// <summary>Internet Protocol.</summary>
|
||||
// Token: 0x04000E25 RID: 3621
|
||||
IP,
|
||||
/// <summary>Internet Control Message Protocol.</summary>
|
||||
// Token: 0x04000E26 RID: 3622
|
||||
Icmp,
|
||||
/// <summary>Internet Group Management Protocol.</summary>
|
||||
// Token: 0x04000E27 RID: 3623
|
||||
Igmp,
|
||||
/// <summary>Gateway To Gateway Protocol.</summary>
|
||||
// Token: 0x04000E28 RID: 3624
|
||||
Ggp,
|
||||
/// <summary>Transmission Control Protocol.</summary>
|
||||
// Token: 0x04000E29 RID: 3625
|
||||
Tcp = 6,
|
||||
/// <summary>PARC Universal Packet Protocol.</summary>
|
||||
// Token: 0x04000E2A RID: 3626
|
||||
Pup = 12,
|
||||
/// <summary>User Datagram Protocol.</summary>
|
||||
// Token: 0x04000E2B RID: 3627
|
||||
Udp = 17,
|
||||
/// <summary>Internet Datagram Protocol.</summary>
|
||||
// Token: 0x04000E2C RID: 3628
|
||||
Idp = 22,
|
||||
/// <summary>Internet Protocol version 6 (IPv6). </summary>
|
||||
// Token: 0x04000E2D RID: 3629
|
||||
IPv6 = 41,
|
||||
/// <summary>Net Disk Protocol (unofficial).</summary>
|
||||
// Token: 0x04000E2E RID: 3630
|
||||
ND = 77,
|
||||
/// <summary>Raw IP packet protocol.</summary>
|
||||
// Token: 0x04000E2F RID: 3631
|
||||
Raw = 255,
|
||||
/// <summary>Unspecified protocol.</summary>
|
||||
// Token: 0x04000E30 RID: 3632
|
||||
Unspecified = 0,
|
||||
/// <summary>Internet Packet Exchange Protocol.</summary>
|
||||
// Token: 0x04000E31 RID: 3633
|
||||
Ipx = 1000,
|
||||
/// <summary>Sequenced Packet Exchange protocol.</summary>
|
||||
// Token: 0x04000E32 RID: 3634
|
||||
Spx = 1256,
|
||||
/// <summary>Sequenced Packet Exchange version 2 protocol.</summary>
|
||||
// Token: 0x04000E33 RID: 3635
|
||||
SpxII,
|
||||
/// <summary>Unknown protocol.</summary>
|
||||
// Token: 0x04000E34 RID: 3636
|
||||
Unknown = -1,
|
||||
/// <summary>Internet Protocol version 4.</summary>
|
||||
// Token: 0x04000E35 RID: 3637
|
||||
IPv4 = 4,
|
||||
/// <summary>IPv6 Routing header.</summary>
|
||||
// Token: 0x04000E36 RID: 3638
|
||||
IPv6RoutingHeader = 43,
|
||||
/// <summary>IPv6 Fragment header.</summary>
|
||||
// Token: 0x04000E37 RID: 3639
|
||||
IPv6FragmentHeader,
|
||||
/// <summary>IPv6 Encapsulating Security Payload header.</summary>
|
||||
// Token: 0x04000E38 RID: 3640
|
||||
IPSecEncapsulatingSecurityPayload = 50,
|
||||
/// <summary>IPv6 Authentication header. For details, see RFC 2292 section 2.2.1, available at http://www.ietf.org.</summary>
|
||||
// Token: 0x04000E39 RID: 3641
|
||||
IPSecAuthenticationHeader,
|
||||
/// <summary>Internet Control Message Protocol for IPv6.</summary>
|
||||
// Token: 0x04000E3A RID: 3642
|
||||
IcmpV6 = 58,
|
||||
/// <summary>IPv6 No next header.</summary>
|
||||
// Token: 0x04000E3B RID: 3643
|
||||
IPv6NoNextHeader,
|
||||
/// <summary>IPv6 Destination Options header.</summary>
|
||||
// Token: 0x04000E3C RID: 3644
|
||||
IPv6DestinationOptions,
|
||||
/// <summary>IPv6 Hop by Hop Options header.</summary>
|
||||
// Token: 0x04000E3D RID: 3645
|
||||
IPv6HopByHopOptions = 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Defines the polling modes for the <see cref="M:System.Net.Sockets.Socket.Poll(System.Int32,System.Net.Sockets.SelectMode)" /> method.</summary>
|
||||
// Token: 0x020001E2 RID: 482
|
||||
public enum SelectMode
|
||||
{
|
||||
/// <summary>Read status mode.</summary>
|
||||
// Token: 0x04000E3F RID: 3647
|
||||
SelectRead,
|
||||
/// <summary>Write status mode.</summary>
|
||||
// Token: 0x04000E40 RID: 3648
|
||||
SelectWrite,
|
||||
/// <summary>Error status mode.</summary>
|
||||
// Token: 0x04000E41 RID: 3649
|
||||
SelectError
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Represents an element in a <see cref="T:System.Net.Sockets.SendPacketsElement" /> array.</summary>
|
||||
// Token: 0x020001E3 RID: 483
|
||||
public class SendPacketsElement
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class using the specified buffer.</summary>
|
||||
/// <param name="buffer">A byte array of data to send using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter cannot be null</exception>
|
||||
// Token: 0x06000F91 RID: 3985 RVA: 0x0002AB34 File Offset: 0x00028D34
|
||||
public SendPacketsElement(byte[] buffer)
|
||||
: this(buffer, 0, (buffer == null) ? 0 : buffer.Length)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class using the specified buffer, buffer offset, and count.</summary>
|
||||
/// <param name="buffer">A byte array of data to send using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
||||
/// <param name="offset">The offset, in bytes, from the beginning of the <paramref name="buffer" /> to the location in the <paramref name="buffer" /> to start sending the data specified in the <paramref name="buffer" /> parameter.</param>
|
||||
/// <param name="count">The number of bytes to send starting from the <paramref name="offset" /> parameter. If <paramref name="count" /> is zero, no bytes are sent.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter cannot be null</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> and <paramref name="count" /> parameters must be greater than or equal to zero. The <paramref name="offset" /> and <paramref name="count" /> must be less than the size of the buffer</exception>
|
||||
// Token: 0x06000F92 RID: 3986 RVA: 0x0002AB50 File Offset: 0x00028D50
|
||||
public SendPacketsElement(byte[] buffer, int offset, int count)
|
||||
: this(buffer, offset, count, false)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class using the specified buffer, buffer offset, and count with an option to combine this element with the next element in a single send request from the sockets layer to the transport. </summary>
|
||||
/// <param name="buffer">A byte array of data to send using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
||||
/// <param name="offset">The offset, in bytes, from the beginning of the <paramref name="buffer" /> to the location in the <paramref name="buffer" /> to start sending the data specified in the <paramref name="buffer" /> parameter.</param>
|
||||
/// <param name="count">The number bytes to send starting from the <paramref name="offset" /> parameter. If <paramref name="count" /> is zero, no bytes are sent.</param>
|
||||
/// <param name="endOfPacket">A Boolean value that specifies that this element should not be combined with the next element in a single send request from the sockets layer to the transport. This flag is used for granular control of the content of each message on a datagram or message-oriented socket. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter cannot be null</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> and <paramref name="count" /> parameters must be greater than or equal to zero. The <paramref name="offset" /> and <paramref name="count" /> must be less than the size of the buffer</exception>
|
||||
// Token: 0x06000F93 RID: 3987 RVA: 0x0002AB5C File Offset: 0x00028D5C
|
||||
public SendPacketsElement(byte[] buffer, int offset, int count, bool endOfPacket)
|
||||
{
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
int num = buffer.Length;
|
||||
if (offset < 0 || offset >= num)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset");
|
||||
}
|
||||
if (count < 0 || offset + count >= num)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("count");
|
||||
}
|
||||
this.Buffer = buffer;
|
||||
this.Offset = offset;
|
||||
this.Count = count;
|
||||
this.EndOfPacket = endOfPacket;
|
||||
this.FilePath = null;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class using the specified file.</summary>
|
||||
/// <param name="filepath">The filename of the file to be transmitted using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="filepath" /> parameter cannot be null</exception>
|
||||
// Token: 0x06000F94 RID: 3988 RVA: 0x0002ABDC File Offset: 0x00028DDC
|
||||
public SendPacketsElement(string filepath)
|
||||
: this(filepath, 0, 0, false)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class using the specified filename path, offset, and count.</summary>
|
||||
/// <param name="filepath">The filename of the file to be transmitted using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
||||
/// <param name="offset">The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the <paramref name="filepath" /> parameter.</param>
|
||||
/// <param name="count">The number of bytes to send starting from the <paramref name="offset" /> parameter. If <paramref name="count" /> is zero, the entire file is sent. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="filepath" /> parameter cannot be null</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> and <paramref name="count" /> parameters must be greater than or equal to zero. The <paramref name="offset" /> and <paramref name="count" /> must be less than the size of the file indicated by the <paramref name="filepath" /> parameter.</exception>
|
||||
// Token: 0x06000F95 RID: 3989 RVA: 0x0002ABE8 File Offset: 0x00028DE8
|
||||
public SendPacketsElement(string filepath, int offset, int count)
|
||||
: this(filepath, offset, count, false)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class using the specified filename path, buffer offset, and count with an option to combine this element with the next element in a single send request from the sockets layer to the transport. </summary>
|
||||
/// <param name="filepath">The filename of the file to be transmitted using the <see cref="M:System.Net.Sockets.Socket.SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.</param>
|
||||
/// <param name="offset">The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the <paramref name="filepath" /> parameter.</param>
|
||||
/// <param name="count">The number of bytes to send starting from the <paramref name="offset" /> parameter. If <paramref name="count" /> is zero, the entire file is sent.</param>
|
||||
/// <param name="endOfPacket">A Boolean value that specifies that this element should not be combined with the next element in a single send request from the sockets layer to the transport. This flag is used for granular control of the content of each message on a datagram or message-oriented socket.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="filepath" /> parameter cannot be null</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> and <paramref name="count" /> parameters must be greater than or equal to zero. The <paramref name="offset" /> and <paramref name="count" /> must be less than the size of the file indicated by the <paramref name="filepath" /> parameter.</exception>
|
||||
// Token: 0x06000F96 RID: 3990 RVA: 0x0002ABF4 File Offset: 0x00028DF4
|
||||
public SendPacketsElement(string filepath, int offset, int count, bool endOfPacket)
|
||||
{
|
||||
if (filepath == null)
|
||||
{
|
||||
throw new ArgumentNullException("filepath");
|
||||
}
|
||||
this.Buffer = null;
|
||||
this.Offset = offset;
|
||||
this.Count = count;
|
||||
this.EndOfPacket = endOfPacket;
|
||||
this.FilePath = filepath;
|
||||
}
|
||||
|
||||
/// <summary>Gets the buffer to be sent if the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class was initialized with a <paramref name="buffer" /> parameter.</summary>
|
||||
/// <returns>The byte buffer to send if the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class was initialized with a <paramref name="buffer" /> parameter.</returns>
|
||||
// Token: 0x17000553 RID: 1363
|
||||
// (get) Token: 0x06000F97 RID: 3991 RVA: 0x0002AC3C File Offset: 0x00028E3C
|
||||
// (set) Token: 0x06000F98 RID: 3992 RVA: 0x0002AC44 File Offset: 0x00028E44
|
||||
public byte[] Buffer { get; private set; }
|
||||
|
||||
/// <summary>Gets the count of bytes to be sent. </summary>
|
||||
/// <returns>The count of bytes to send if the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class was initialized with a <paramref name="count" /> parameter.</returns>
|
||||
// Token: 0x17000554 RID: 1364
|
||||
// (get) Token: 0x06000F99 RID: 3993 RVA: 0x0002AC50 File Offset: 0x00028E50
|
||||
// (set) Token: 0x06000F9A RID: 3994 RVA: 0x0002AC58 File Offset: 0x00028E58
|
||||
public int Count { get; private set; }
|
||||
|
||||
/// <summary>Gets a Boolean value that indicates if this element should not be combined with the next element in a single send request from the sockets layer to the transport.</summary>
|
||||
/// <returns>A Boolean value that indicates if this element should not be combined with the next element in a single send request.</returns>
|
||||
// Token: 0x17000555 RID: 1365
|
||||
// (get) Token: 0x06000F9B RID: 3995 RVA: 0x0002AC64 File Offset: 0x00028E64
|
||||
// (set) Token: 0x06000F9C RID: 3996 RVA: 0x0002AC6C File Offset: 0x00028E6C
|
||||
public bool EndOfPacket { get; private set; }
|
||||
|
||||
/// <summary>Gets the filename of the file to send if the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class was initialized with a <paramref name="filepath" /> parameter.</summary>
|
||||
/// <returns>The filename of the file to send if the <see cref="T:System.Net.Sockets.SendPacketsElement" /> class was initialized with a <paramref name="filepath" /> parameter.</returns>
|
||||
// Token: 0x17000556 RID: 1366
|
||||
// (get) Token: 0x06000F9D RID: 3997 RVA: 0x0002AC78 File Offset: 0x00028E78
|
||||
// (set) Token: 0x06000F9E RID: 3998 RVA: 0x0002AC80 File Offset: 0x00028E80
|
||||
public string FilePath { get; private set; }
|
||||
|
||||
/// <summary>Gets the offset, in bytes, from the beginning of the data buffer or file to the location in the buffer or file to start sending the data. </summary>
|
||||
/// <returns>The offset, in bytes, from the beginning of the data buffer or file to the location in the buffer or file to start sending the data.</returns>
|
||||
// Token: 0x17000557 RID: 1367
|
||||
// (get) Token: 0x06000F9F RID: 3999 RVA: 0x0002AC8C File Offset: 0x00028E8C
|
||||
// (set) Token: 0x06000FA0 RID: 4000 RVA: 0x0002AC94 File Offset: 0x00028E94
|
||||
public int Offset { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5668 @@
|
||||
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
|
||||
{
|
||||
/// <summary>Implements the Berkeley sockets interface.</summary>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.Socket" /> class using the specified value returned from <see cref="M:System.Net.Sockets.Socket.DuplicateAndClose(System.Int32)" />.</summary>
|
||||
/// <param name="socketInformation">The socket information returned by <see cref="M:System.Net.Sockets.Socket.DuplicateAndClose(System.Int32)" />.</param>
|
||||
// Token: 0x06000FA2 RID: 4002 RVA: 0x0002AD14 File Offset: 0x00028F14
|
||||
[global::System.MonoTODO]
|
||||
public Socket(SocketInformation socketInformation)
|
||||
{
|
||||
throw new NotImplementedException("SocketInformation not figured out yet");
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.Socket" /> class using the specified address family, socket type and protocol.</summary>
|
||||
/// <param name="addressFamily">One of the <see cref="T:System.Net.Sockets.AddressFamily" /> values. </param>
|
||||
/// <param name="socketType">One of the <see cref="T:System.Net.Sockets.SocketType" /> values. </param>
|
||||
/// <param name="protocolType">One of the <see cref="T:System.Net.Sockets.ProtocolType" /> values. </param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">The combination of <paramref name="addressFamily" />, <paramref name="socketType" />, and <paramref name="protocolType" /> results in an invalid socket. </exception>
|
||||
// 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);
|
||||
|
||||
/// <summary>Determines the status of one or more sockets.</summary>
|
||||
/// <param name="checkRead">An <see cref="T:System.Collections.IList" /> of <see cref="T:System.Net.Sockets.Socket" /> instances to check for readability. </param>
|
||||
/// <param name="checkWrite">An <see cref="T:System.Collections.IList" /> of <see cref="T:System.Net.Sockets.Socket" /> instances to check for writability. </param>
|
||||
/// <param name="checkError">An <see cref="T:System.Collections.IList" /> of <see cref="T:System.Net.Sockets.Socket" /> instances to check for errors. </param>
|
||||
/// <param name="microSeconds">The time-out value, in microseconds. A -1 value indicates an infinite time-out.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="checkRead" /> parameter is null or empty.-and- The <paramref name="checkWrite" /> parameter is null or empty -and- The <paramref name="checkError" /> parameter is null or empty. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
// 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);
|
||||
|
||||
/// <summary>Gets the amount of data that has been received from the network and is available to be read.</summary>
|
||||
/// <returns>The number of bytes of data received from the network and available to be read.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a <see cref="T:System.Boolean" /> value that specifies whether the <see cref="T:System.Net.Sockets.Socket" /> allows Internet Protocol (IP) datagrams to be fragmented.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.Socket" /> allows datagram fragmentation; otherwise, false. The default is true.</returns>
|
||||
/// <exception cref="T:System.NotSupportedException">This property can be set only for sockets in the <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /> or <see cref="F:System.Net.Sockets.AddressFamily.InterNetworkV6" /> families. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a <see cref="T:System.Boolean" /> value that specifies whether the <see cref="T:System.Net.Sockets.Socket" /> can send or receive broadcast packets.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.Socket" /> allows broadcast packets; otherwise, false. The default is false.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">This option is valid for a datagram socket only. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a <see cref="T:System.Boolean" /> value that specifies whether the <see cref="T:System.Net.Sockets.Socket" /> allows only one process to bind to a port.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.Socket" /> 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.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.Bind(System.Net.EndPoint)" /> has been called for this <see cref="T:System.Net.Sockets.Socket" />.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether the <see cref="T:System.Net.Sockets.Socket" /> is bound to a specific local port.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.Socket" /> is bound to a local port; otherwise, false.</returns>
|
||||
// Token: 0x1700055C RID: 1372
|
||||
// (get) Token: 0x06000FB1 RID: 4017 RVA: 0x0002B38C File Offset: 0x0002958C
|
||||
public bool IsBound
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.isbound;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that specifies whether the <see cref="T:System.Net.Sockets.Socket" /> will delay closing a socket in an attempt to send all pending data.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.LingerOption" /> that specifies how to linger while closing a socket.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that specifies whether outgoing multicast packets are delivered to the sending application.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.Socket" /> receives outgoing multicast packets; otherwise, false.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Specifies whether the socket should only use Overlapped I/O mode.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.Socket" /> uses only overlapped I/O; otherwise, false. The default is false.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The socket has been bound to a completion port.</exception>
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the operating system handle for the <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IntPtr" /> that represents the operating system handle for the <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
|
||||
/// <summary>Gets the local endpoint.</summary>
|
||||
/// <returns>The <see cref="T:System.Net.EndPoint" /> that the <see cref="T:System.Net.Sockets.Socket" /> is using for communications.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the type of the <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>One of the <see cref="T:System.Net.Sockets.SocketType" /> values.</returns>
|
||||
// Token: 0x17000562 RID: 1378
|
||||
// (get) Token: 0x06000FBB RID: 4027 RVA: 0x0002B5FC File Offset: 0x000297FC
|
||||
public SocketType SocketType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.socket_type;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that specifies the amount of time after which a synchronous <see cref="Overload:System.Net.Sockets.Socket.Send" /> call will time out.</summary>
|
||||
/// <returns>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.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The value specified for a set operation is less than -1.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that specifies the amount of time after which a synchronous <see cref="Overload:System.Net.Sockets.Socket.Receive" /> call will time out.</summary>
|
||||
/// <returns>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.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The value specified for a set operation is less than -1.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous operation to accept an incoming connection attempt.</summary>
|
||||
/// <returns>Returns true if the I/O operation is pending. The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will be raised upon completion of the operation.Returns false if the I/O operation completed synchronously. The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will not be raised and the <paramref name="e" /> object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.</returns>
|
||||
/// <param name="e">The <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object to use for this asynchronous socket operation.</param>
|
||||
/// <exception cref="T:System.ArgumentException">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 <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.BufferList" /> property is not null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">An argument is out of range. The exception occurs if the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Count" /> is less than 0.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">An invalid operation was requested. This exception occurs if the accepting <see cref="T:System.Net.Sockets.Socket" /> is not listening for connections or the accepted socket is bound. You must call the <see cref="M:System.Net.Sockets.Socket.Bind(System.Net.EndPoint)" /> and <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" /> method before calling the <see cref="M:System.Net.Sockets.Socket.AcceptAsync(System.Net.Sockets.SocketAsyncEventArgs)" /> method.This exception also occurs if the socket is already connected or a socket operation was already in progress using the specified <paramref name="e" /> parameter. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows XP or later is required for this method.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// 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);
|
||||
|
||||
/// <summary>Creates a new <see cref="T:System.Net.Sockets.Socket" /> for a newly created connection.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.Socket" /> for a newly created connection.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The accepting socket is not listening for connections. You must call <see cref="M:System.Net.Sockets.Socket.Bind(System.Net.EndPoint)" /> and <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" /> before calling <see cref="M:System.Net.Sockets.Socket.Accept" />. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous operation to accept an incoming connection attempt.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous <see cref="T:System.Net.Sockets.Socket" /> creation.</returns>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows NT is required for this method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The accepting socket is not listening for connections. You must call <see cref="M:System.Net.Sockets.Socket.Bind(System.Net.EndPoint)" /> and <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" /> before calling <see cref="M:System.Net.Sockets.Socket.BeginAccept(System.AsyncCallback,System.Object)" />.-or- The accepted socket is bound. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="receiveSize" /> is less than 0. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous operation to accept an incoming connection attempt and receives the first block of data sent by the client application.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous <see cref="T:System.Net.Sockets.Socket" /> creation.</returns>
|
||||
/// <param name="receiveSize">The number of bytes to accept from the sender. </param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows NT is required for this method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The accepting socket is not listening for connections. You must call <see cref="M:System.Net.Sockets.Socket.Bind(System.Net.EndPoint)" /> and <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" /> before calling <see cref="M:System.Net.Sockets.Socket.BeginAccept(System.AsyncCallback,System.Object)" />.-or- The accepted socket is bound. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="receiveSize" /> is less than 0. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>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.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that references the asynchronous <see cref="T:System.Net.Sockets.Socket" /> object creation.</returns>
|
||||
/// <param name="acceptSocket">The accepted <see cref="T:System.Net.Sockets.Socket" /> object. This value may be null. </param>
|
||||
/// <param name="receiveSize">The maximum number of bytes to receive. </param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows NT is required for this method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The accepting socket is not listening for connections. You must call <see cref="M:System.Net.Sockets.Socket.Bind(System.Net.EndPoint)" /> and <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" /> before calling <see cref="M:System.Net.Sockets.Socket.BeginAccept(System.AsyncCallback,System.Object)" />.-or- The accepted socket is bound. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="receiveSize" /> is less than 0. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous request for a remote host connection.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous connection.</returns>
|
||||
/// <param name="remoteEP">An <see cref="T:System.Net.EndPoint" /> that represents the remote host. </param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller higher in the call stack does not have permission for the requested operation. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.Socket" /> is <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" />ing.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous request for a remote host connection. The host is specified by an <see cref="T:System.Net.IPAddress" /> and a port number.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous connection.</returns>
|
||||
/// <param name="address">The <see cref="T:System.Net.IPAddress" /> of the remote host.</param>
|
||||
/// <param name="port">The port number of the remote host.</param>
|
||||
/// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the connect operation is complete. </param>
|
||||
/// <param name="state">A user-defined object that contains information about the connect operation. This object is passed to the <paramref name="requestCallback" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="address" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Net.Sockets.Socket" /> is not in the socket family.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The port number is not valid.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The length of <paramref name="address" /> is zero.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.Socket" /> is <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" />ing.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous request for a remote host connection. The host is specified by an <see cref="T:System.Net.IPAddress" /> array and a port number.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous connections.</returns>
|
||||
/// <param name="addresses">At least one <see cref="T:System.Net.IPAddress" />, designating the remote host.</param>
|
||||
/// <param name="port">The port number of the remote host.</param>
|
||||
/// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the connect operation is complete. </param>
|
||||
/// <param name="state">A user-defined object that contains information about the connect operation. This object is passed to the <paramref name="requestCallback" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="addresses" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">This method is valid for sockets that use <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /> or <see cref="F:System.Net.Sockets.AddressFamily.InterNetworkV6" />.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The port number is not valid.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The length of <paramref name="address" /> is zero.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.Socket" /> is <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" />ing.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous request for a remote host connection. The host is specified by a host name and a port number.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous connection.</returns>
|
||||
/// <param name="host">The name of the remote host.</param>
|
||||
/// <param name="port">The port number of the remote host.</param>
|
||||
/// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the connect operation is complete. </param>
|
||||
/// <param name="state">A user-defined object that contains information about the connect operation. This object is passed to the <paramref name="requestCallback" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="host" /> is null. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">This method is valid for sockets in the <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /> or <see cref="F:System.Net.Sockets.AddressFamily.InterNetworkV6" /> families.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The port number is not valid.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.Socket" /> is <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" />ing.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous request to disconnect from a remote endpoint.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that references the asynchronous operation.</returns>
|
||||
/// <param name="reuseSocket">true if this socket can be reused after the connection is closed; otherwise, false. </param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.NotSupportedException">The operating system is Windows 2000 or earlier, and this method requires Windows XP. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins to asynchronously receive data from a connected <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous read.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for the received data. </param>
|
||||
/// <param name="offset">The zero-based position in the <paramref name="buffer" /> parameter at which to store the received data. </param>
|
||||
/// <param name="size">The number of bytes to receive. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="callback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete. </param>
|
||||
/// <param name="state">A user-defined object that contains information about the receive operation. This object is passed to the <see cref="M:System.Net.Sockets.Socket.EndReceive(System.IAsyncResult)" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">
|
||||
/// <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins to asynchronously receive data from a connected <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous read.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for the received data.</param>
|
||||
/// <param name="offset">The location in <paramref name="buffer" /> to store the received data. </param>
|
||||
/// <param name="size">The number of bytes to receive. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values.</param>
|
||||
/// <param name="errorCode">A <see cref="T:System.Net.Sockets.SocketError" /> object that stores the socket error.</param>
|
||||
/// <param name="callback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete.</param>
|
||||
/// <param name="state">A user-defined object that contains information about the receive operation. This object is passed to the <see cref="M:System.Net.Sockets.Socket.EndReceive(System.IAsyncResult)" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">
|
||||
/// <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Begins to asynchronously receive data from a connected <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous read.</returns>
|
||||
/// <param name="buffers">An array of type <see cref="T:System.Byte" /> that is the storage location for the received data.</param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values.</param>
|
||||
/// <param name="callback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete.</param>
|
||||
/// <param name="state">A user-defined object that contains information about the receive operation. This object is passed to the <see cref="M:System.Net.Sockets.Socket.EndReceive(System.IAsyncResult)" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">
|
||||
/// <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x06000FCF RID: 4047 RVA: 0x0002C150 File Offset: 0x0002A350
|
||||
[CLSCompliant(false)]
|
||||
public IAsyncResult BeginReceive(IList<ArraySegment<byte>> 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins to asynchronously receive data from a connected <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous read.</returns>
|
||||
/// <param name="buffers">An array of type <see cref="T:System.Byte" /> that is the storage location for the received data.</param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="errorCode">A <see cref="T:System.Net.Sockets.SocketError" /> object that stores the socket error.</param>
|
||||
/// <param name="callback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete.</param>
|
||||
/// <param name="state">A user-defined object that contains information about the receive operation. This object is passed to the <see cref="M:System.Net.Sockets.Socket.EndReceive(System.IAsyncResult)" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">
|
||||
/// <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x06000FD0 RID: 4048 RVA: 0x0002C220 File Offset: 0x0002A420
|
||||
[CLSCompliant(false)]
|
||||
public IAsyncResult BeginReceive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
|
||||
{
|
||||
errorCode = SocketError.Success;
|
||||
return this.BeginReceive(buffers, socketFlags, callback, state);
|
||||
}
|
||||
|
||||
/// <summary>Begins to asynchronously receive data from a specified network device.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous read.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for the received data. </param>
|
||||
/// <param name="offset">The zero-based position in the <paramref name="buffer" /> parameter at which to store the data. </param>
|
||||
/// <param name="size">The number of bytes to receive. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="remoteEP">An <see cref="T:System.Net.EndPoint" /> that represents the source of the data. </param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.-or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller higher in the call stack does not have permission for the requested operation. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins to asynchronously receive the specified number of bytes of data into the specified location of the data buffer, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />, and stores the endpoint and packet information..</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous read.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for the received data. </param>
|
||||
/// <param name="offset">The zero-based position in the <paramref name="buffer" /> parameter at which to store the data.</param>
|
||||
/// <param name="size">The number of bytes to receive. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values.</param>
|
||||
/// <param name="remoteEP">An <see cref="T:System.Net.EndPoint" /> that represents the source of the data.</param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate.</param>
|
||||
/// <param name="state">An object that contains state information for this request.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.-or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The operating system is Windows 2000 or earlier, and this method requires Windows XP.</exception>
|
||||
// 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();
|
||||
}
|
||||
|
||||
/// <summary>Sends data asynchronously to a connected <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous send.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to send. </param>
|
||||
/// <param name="offset">The zero-based position in the <paramref name="buffer" /> parameter at which to begin sending data. </param>
|
||||
/// <param name="size">The number of bytes to send. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See remarks section below. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is less than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Sends data asynchronously to a connected <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous send.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to send. </param>
|
||||
/// <param name="offset">The zero-based position in the <paramref name="buffer" /> parameter at which to begin sending data. </param>
|
||||
/// <param name="size">The number of bytes to send. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="errorCode">A <see cref="T:System.Net.Sockets.SocketError" /> object that stores the socket error.</param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See remarks section below. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is less than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Sends data asynchronously to a connected <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous send.</returns>
|
||||
/// <param name="buffers">An array of type <see cref="T:System.Byte" /> that contains the data to send. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffers" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="buffers" /> is empty.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See remarks section below. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x06000FD5 RID: 4053 RVA: 0x0002C570 File Offset: 0x0002A770
|
||||
public IAsyncResult BeginSend(IList<ArraySegment<byte>> 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;
|
||||
}
|
||||
|
||||
/// <summary>Sends data asynchronously to a connected <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous send.</returns>
|
||||
/// <param name="buffers">An array of type <see cref="T:System.Byte" /> that contains the data to send. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values.</param>
|
||||
/// <param name="errorCode">A <see cref="T:System.Net.Sockets.SocketError" /> object that stores the socket error.</param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffers" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="buffers" /> is empty.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See remarks section below. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x06000FD6 RID: 4054 RVA: 0x0002C658 File Offset: 0x0002A858
|
||||
[CLSCompliant(false)]
|
||||
public IAsyncResult BeginSend(IList<ArraySegment<byte>> 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);
|
||||
}
|
||||
|
||||
/// <summary>Sends the file <paramref name="fileName" /> to a connected <see cref="T:System.Net.Sockets.Socket" /> object using the <see cref="F:System.Net.Sockets.TransmitFileOptions.UseDefaultWorkerThread" /> flag.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that represents the asynchronous send.</returns>
|
||||
/// <param name="fileName">A string that contains the path and name of the file to send. This parameter can be null. </param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The socket is not connected to a remote host. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">The file <paramref name="fileName" /> was not found. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See remarks section below. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Sends a file and buffers of data asynchronously to a connected <see cref="T:System.Net.Sockets.Socket" /> object.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that represents the asynchronous operation.</returns>
|
||||
/// <param name="fileName">A string that contains the path and name of the file to be sent. This parameter can be null. </param>
|
||||
/// <param name="preBuffer">A <see cref="T:System.Byte" /> array that contains data to be sent before the file is sent. This parameter can be null. </param>
|
||||
/// <param name="postBuffer">A <see cref="T:System.Byte" /> array that contains data to be sent after the file is sent. This parameter can be null. </param>
|
||||
/// <param name="flags">A bitwise combination of <see cref="T:System.Net.Sockets.TransmitFileOptions" /> values. </param>
|
||||
/// <param name="callback">An <see cref="T:System.AsyncCallback" /> delegate to be invoked when this operation completes. This parameter can be null. </param>
|
||||
/// <param name="state">A user-defined object that contains state information for this request. This parameter can be null. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See remarks section below. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The operating system is not Windows NT or later.- or - The socket is not connected to a remote host. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">The file <paramref name="fileName" /> was not found. </exception>
|
||||
// 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));
|
||||
}
|
||||
|
||||
/// <summary>Sends data asynchronously to a specific remote host.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous send.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to send. </param>
|
||||
/// <param name="offset">The zero-based position in <paramref name="buffer" /> at which to begin sending data. </param>
|
||||
/// <param name="size">The number of bytes to send. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="remoteEP">An <see cref="T:System.Net.EndPoint" /> that represents the remote device. </param>
|
||||
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
|
||||
/// <param name="state">An object that contains state information for this request. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.-or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller higher in the call stack does not have permission for the requested operation. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
|
||||
/// <summary>Associates a <see cref="T:System.Net.Sockets.Socket" /> with a local endpoint.</summary>
|
||||
/// <param name="localEP">The local <see cref="T:System.Net.EndPoint" /> to associate with the <see cref="T:System.Net.Sockets.Socket" />. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="localEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller higher in the call stack does not have permission for the requested operation. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous request for a remote host connection.</summary>
|
||||
/// <returns>Returns true if the I/O operation is pending. The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will not be raised and the <paramref name="e" /> object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation. </returns>
|
||||
/// <param name="e">The <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object to use for this asynchronous socket operation.</param>
|
||||
/// <exception cref="T:System.ArgumentException">An argument is not valid. This exception occurs if multiple buffers are specified, the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.BufferList" /> property is not null. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="e" /> parameter cannot be null and the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.RemoteEndPoint" /> cannot be null.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.Socket" /> is listening or a socket operation was already in progress using the <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object specified in the <paramref name="e" /> parameter.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows XP or later is required for this method. This exception also occurs if the local endpoint and the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.RemoteEndPoint" /> are not the same address family.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller higher in the call stack does not have permission for the requested operation.</exception>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Establishes a connection to a remote host. The host is specified by an IP address and a port number.</summary>
|
||||
/// <param name="address">The IP address of the remote host.</param>
|
||||
/// <param name="port">The port number of the remote host.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="address" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The port number is not valid.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">This method is valid for sockets in the <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /> or <see cref="F:System.Net.Sockets.AddressFamily.InterNetworkV6" /> families.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The length of <paramref name="address" /> is zero.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.Socket" /> is <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" />ing.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06000FDD RID: 4061 RVA: 0x0002C9D8 File Offset: 0x0002ABD8
|
||||
public void Connect(IPAddress address, int port)
|
||||
{
|
||||
this.Connect(new IPEndPoint(address, port));
|
||||
}
|
||||
|
||||
/// <summary>Establishes a connection to a remote host. The host is specified by an array of IP addresses and a port number.</summary>
|
||||
/// <param name="addresses">The IP addresses of the remote host.</param>
|
||||
/// <param name="port">The port number of the remote host.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="addresses" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The port number is not valid.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">This method is valid for sockets in the <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /> or <see cref="F:System.Net.Sockets.AddressFamily.InterNetworkV6" /> families.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The length of <paramref name="address" /> is zero.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.Socket" /> is <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" />ing.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Establishes a connection to a remote host. The host is specified by a host name and a port number.</summary>
|
||||
/// <param name="host">The name of the remote host.</param>
|
||||
/// <param name="port">The port number of the remote host.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="host" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The port number is not valid.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">This method is valid for sockets in the <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /> or <see cref="F:System.Net.Sockets.AddressFamily.InterNetworkV6" /> families.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.Socket" /> is <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" />ing.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous request to disconnect from a remote endpoint.</summary>
|
||||
/// <returns>Returns true if the I/O operation is pending. The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will not be raised and the <paramref name="e" /> object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.</returns>
|
||||
/// <param name="e">The <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object to use for this asynchronous socket operation.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="e" /> parameter cannot be null.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">A socket operation was already in progress using the <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object specified in the <paramref name="e" /> parameter.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows XP or later is required for this method.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. </exception>
|
||||
// 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);
|
||||
|
||||
/// <summary>Closes the socket connection and allows reuse of the socket.</summary>
|
||||
/// <param name="reuseSocket">true if this socket can be reused after the current connection is closed; otherwise, false. </param>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">This method requires Windows 2000 or earlier, or the exception will be thrown.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Duplicates the socket reference for the target process, and closes the socket for this process.</summary>
|
||||
/// <returns>The socket reference to be passed to the target process.</returns>
|
||||
/// <param name="targetProcessId">The ID of the target process where a duplicate of the socket reference is created.</param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">
|
||||
/// <paramref name="targetProcessID" /> is not a valid process id.-or- Duplication of the socket reference failed. </exception>
|
||||
// Token: 0x06000FE3 RID: 4067 RVA: 0x0002CBE8 File Offset: 0x0002ADE8
|
||||
[global::System.MonoTODO("Not implemented")]
|
||||
public SocketInformation DuplicateAndClose(int targetProcessId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>Asynchronously accepts an incoming connection attempt and creates a new <see cref="T:System.Net.Sockets.Socket" /> to handle remote host communication.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.Socket" /> to handle communication with the remote host.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that stores state information for this asynchronous operation as well as any user defined data. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not created by a call to <see cref="M:System.Net.Sockets.Socket.BeginAccept(System.AsyncCallback,System.Object)" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndAccept(System.IAsyncResult)" /> method was previously called. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows NT is required for this method. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Asynchronously accepts an incoming connection attempt and creates a new <see cref="T:System.Net.Sockets.Socket" /> object to handle remote host communication. This method returns a buffer that contains the initial data transferred.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.Socket" /> object to handle communication with the remote host.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the bytes transferred. </param>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> object that stores state information for this asynchronous operation as well as any user defined data. </param>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows NT is required for this method. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is empty. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not created by a call to <see cref="M:System.Net.Sockets.Socket.BeginAccept(System.AsyncCallback,System.Object)" />. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndAccept(System.IAsyncResult)" /> method was previously called. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the <see cref="T:System.Net.Sockets.Socket" /> See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Asynchronously accepts an incoming connection attempt and creates a new <see cref="T:System.Net.Sockets.Socket" /> object to handle remote host communication. This method returns a buffer that contains the initial data and the number of bytes transferred.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.Socket" /> object to handle communication with the remote host.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the bytes transferred. </param>
|
||||
/// <param name="bytesTransferred">The number of bytes transferred. </param>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> object that stores state information for this asynchronous operation as well as any user defined data. </param>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows NT is required for this method. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is empty. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not created by a call to <see cref="M:System.Net.Sockets.Socket.BeginAccept(System.AsyncCallback,System.Object)" />. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndAccept(System.IAsyncResult)" /> method was previously called. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the <see cref="T:System.Net.Sockets.Socket" />. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous connection request.</summary>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that stores state information and any user defined data for this asynchronous operation. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.Socket.BeginConnect(System.Net.EndPoint,System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndConnect(System.IAsyncResult)" /> was previously called for the asynchronous connection. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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();
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous disconnect request.</summary>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> object that stores state information and any user-defined data for this asynchronous operation. </param>
|
||||
/// <exception cref="T:System.NotSupportedException">The operating system is Windows 2000 or earlier, and this method requires Windows XP. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.Socket.BeginDisconnect(System.Boolean,System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndDisconnect(System.IAsyncResult)" /> was previously called for the asynchronous connection. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.Net.WebException">The disconnect request has timed out. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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();
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous read.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that stores state information and any user defined data for this asynchronous operation. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.Socket.BeginReceive(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndReceive(System.IAsyncResult)" /> was previously called for the asynchronous read. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06000FE9 RID: 4073 RVA: 0x0002CE14 File Offset: 0x0002B014
|
||||
public int EndReceive(IAsyncResult result)
|
||||
{
|
||||
SocketError socketError;
|
||||
return this.EndReceive(result, out socketError);
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous read.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that stores state information and any user defined data for this asynchronous operation.</param>
|
||||
/// <param name="errorCode">A <see cref="T:System.Net.Sockets.SocketError" /> object that stores the socket error.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.Socket.BeginReceive(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndReceive(System.IAsyncResult)" /> was previously called for the asynchronous read. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous read from a specific endpoint.</summary>
|
||||
/// <returns>If successful, the number of bytes received. If unsuccessful, returns 0.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that stores state information and any user defined data for this asynchronous operation. </param>
|
||||
/// <param name="endPoint">The source <see cref="T:System.Net.EndPoint" />. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.Socket.BeginReceiveFrom(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.Net.EndPoint@,System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndReceiveFrom(System.IAsyncResult,System.Net.EndPoint@)" /> was previously called for the asynchronous read. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous read from a specific endpoint. This method also reveals more information about the packet than <see cref="M:System.Net.Sockets.Socket.EndReceiveFrom(System.IAsyncResult,System.Net.EndPoint@)" />.</summary>
|
||||
/// <returns>If successful, the number of bytes received. If unsuccessful, returns 0.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that stores state information and any user defined data for this asynchronous operation.</param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values for the received packet.</param>
|
||||
/// <param name="endPoint">The source <see cref="T:System.Net.EndPoint" />.</param>
|
||||
/// <param name="ipPacketInformation">The <see cref="T:System.Net.IPAddress" /> and interface of the received packet.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null-or- <paramref name="endPoint" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.Socket.BeginReceiveMessageFrom(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.Net.EndPoint@,System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndReceiveMessageFrom(System.IAsyncResult,System.Net.Sockets.SocketFlags@,System.Net.EndPoint@,System.Net.Sockets.IPPacketInformation@)" /> was previously called for the asynchronous read. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// 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();
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous send.</summary>
|
||||
/// <returns>If successful, the number of bytes sent to the <see cref="T:System.Net.Sockets.Socket" />; otherwise, an invalid <see cref="T:System.Net.Sockets.Socket" /> error.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that stores state information for this asynchronous operation. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.Socket.BeginSend(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndSend(System.IAsyncResult)" /> was previously called for the asynchronous send. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06000FED RID: 4077 RVA: 0x0002D01C File Offset: 0x0002B21C
|
||||
public int EndSend(IAsyncResult result)
|
||||
{
|
||||
SocketError socketError;
|
||||
return this.EndSend(result, out socketError);
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous send.</summary>
|
||||
/// <returns>If successful, the number of bytes sent to the <see cref="T:System.Net.Sockets.Socket" />; otherwise, an invalid <see cref="T:System.Net.Sockets.Socket" /> error.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that stores state information for this asynchronous operation.</param>
|
||||
/// <param name="errorCode">A <see cref="T:System.Net.Sockets.SocketError" /> object that stores the socket error.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.Socket.BeginSend(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndSend(System.IAsyncResult)" /> was previously called for the asynchronous send. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous send of a file.</summary>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> object that stores state information for this asynchronous operation. </param>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows NT is required for this method. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is empty. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.Socket.BeginSendFile(System.String,System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndSendFile(System.IAsyncResult)" /> was previously called for the asynchronous <see cref="M:System.Net.Sockets.Socket.BeginSendFile(System.String,System.AsyncCallback,System.Object)" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See remarks section below. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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");
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous send to a specific location.</summary>
|
||||
/// <returns>If successful, the number of bytes sent; otherwise, an invalid <see cref="T:System.Net.Sockets.Socket" /> error.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that stores state information and any user defined data for this asynchronous operation. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.Socket.BeginSendTo(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.Net.EndPoint,System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndSendTo(System.IAsyncResult)" /> was previously called for the asynchronous send. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
|
||||
/// <summary>Returns the specified <see cref="T:System.Net.Sockets.Socket" /> option setting, represented as a byte array.</summary>
|
||||
/// <param name="optionLevel">One of the <see cref="T:System.Net.Sockets.SocketOptionLevel" /> values. </param>
|
||||
/// <param name="optionName">One of the <see cref="T:System.Net.Sockets.SocketOptionName" /> values. </param>
|
||||
/// <param name="optionValue">An array of type <see cref="T:System.Byte" /> that is to receive the option setting. </param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">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 <see cref="Overload:System.Net.Sockets.Socket.SetSocketOption" />.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns the value of the specified <see cref="T:System.Net.Sockets.Socket" /> option in an array.</summary>
|
||||
/// <returns>An array of type <see cref="T:System.Byte" /> that contains the value of the socket option.</returns>
|
||||
/// <param name="optionLevel">One of the <see cref="T:System.Net.Sockets.SocketOptionLevel" /> values. </param>
|
||||
/// <param name="optionName">One of the <see cref="T:System.Net.Sockets.SocketOptionName" /> values. </param>
|
||||
/// <param name="optionLength">The length, in bytes, of the expected return value. </param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">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 <see cref="Overload:System.Net.Sockets.Socket.SetSocketOption" />.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
|
||||
/// <summary>Sets low-level operating modes for the <see cref="T:System.Net.Sockets.Socket" /> using numerical control codes.</summary>
|
||||
/// <returns>The number of bytes in the <paramref name="optionOutValue" /> parameter.</returns>
|
||||
/// <param name="ioControlCode">An <see cref="T:System.Int32" /> value that specifies the control code of the operation to perform. </param>
|
||||
/// <param name="optionInValue">A <see cref="T:System.Byte" /> array that contains the input data required by the operation. </param>
|
||||
/// <param name="optionOutValue">A <see cref="T:System.Byte" /> array that contains the output data returned by the operation. </param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">An attempt was made to change the blocking mode without using the <see cref="P:System.Net.Sockets.Socket.Blocking" /> property. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller in the call stack does not have the required permissions. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Sets low-level operating modes for the <see cref="T:System.Net.Sockets.Socket" /> using the <see cref="T:System.Net.Sockets.IOControlCode" /> enumeration to specify control codes.</summary>
|
||||
/// <returns>The number of bytes in the <paramref name="optionOutValue" /> parameter.</returns>
|
||||
/// <param name="ioControlCode">A <see cref="T:System.Net.Sockets.IOControlCode" /> value that specifies the control code of the operation to perform. </param>
|
||||
/// <param name="optionInValue">An array of type <see cref="T:System.Byte" /> that contains the input data required by the operation. </param>
|
||||
/// <param name="optionOutValue">An array of type <see cref="T:System.Byte" /> that contains the output data returned by the operation. </param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">An attempt was made to change the blocking mode without using the <see cref="P:System.Net.Sockets.Socket.Blocking" /> property. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
|
||||
/// <summary>Places a <see cref="T:System.Net.Sockets.Socket" /> in a listening state.</summary>
|
||||
/// <param name="backlog">The maximum length of the pending connections queue. </param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Determines the status of the <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>The status of the <see cref="T:System.Net.Sockets.Socket" /> based on the polling mode value passed in the <paramref name="mode" /> parameter.Mode Return Value <see cref="F:System.Net.Sockets.SelectMode.SelectRead" />true if <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" /> 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. <see cref="F:System.Net.Sockets.SelectMode.SelectWrite" />true, if processing a <see cref="M:System.Net.Sockets.Socket.Connect(System.Net.EndPoint)" />, and the connection has succeeded; -or- true if data can be sent; otherwise, returns false. <see cref="F:System.Net.Sockets.SelectMode.SelectError" />true if processing a <see cref="M:System.Net.Sockets.Socket.Connect(System.Net.EndPoint)" /> that does not block, and the connection has failed; -or- true if <see cref="F:System.Net.Sockets.SocketOptionName.OutOfBandInline" /> is not set and out-of-band data is available; otherwise, returns false. </returns>
|
||||
/// <param name="microSeconds">The time to wait for a response, in microseconds. </param>
|
||||
/// <param name="mode">One of the <see cref="T:System.Net.Sockets.SelectMode" /> values. </param>
|
||||
/// <exception cref="T:System.NotSupportedException">The <paramref name="mode" /> parameter is not one of the <see cref="T:System.Net.Sockets.SelectMode" /> values. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See remarks below. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Receives data from a bound <see cref="T:System.Net.Sockets.Socket" /> into a receive buffer.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for the received data. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller in the call stack does not have the required permissions. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Receives data from a bound <see cref="T:System.Net.Sockets.Socket" /> into a receive buffer, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for the received data. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller in the call stack does not have the required permissions. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Receives the specified number of bytes of data from a bound <see cref="T:System.Net.Sockets.Socket" /> into a receive buffer, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for the received data. </param>
|
||||
/// <param name="size">The number of bytes to receive. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="size" /> exceeds the size of <paramref name="buffer" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller in the call stack does not have the required permissions. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Receives the specified number of bytes from a bound <see cref="T:System.Net.Sockets.Socket" /> into the specified offset position of the receive buffer, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for received data. </param>
|
||||
/// <param name="offset">The location in <paramref name="buffer" /> to store the received data. </param>
|
||||
/// <param name="size">The number of bytes to receive. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">
|
||||
/// <paramref name="socketFlags" /> is not a valid combination of values.-or- The <see cref="P:System.Net.Sockets.Socket.LocalEndPoint" /> property was not set.-or- An operating system error occurs while accessing the <see cref="T:System.Net.Sockets.Socket" />. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller in the call stack does not have the required permissions. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Receives data from a bound <see cref="T:System.Net.Sockets.Socket" /> into a receive buffer, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for the received data.</param>
|
||||
/// <param name="offset">The position in the <paramref name="buffer" /> parameter to store the received data. </param>
|
||||
/// <param name="size">The number of bytes to receive. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values.</param>
|
||||
/// <param name="errorCode">A <see cref="T:System.Net.Sockets.SocketError" /> object that stores the socket error.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">
|
||||
/// <paramref name="socketFlags" /> is not a valid combination of values.-or- The <see cref="P:System.Net.Sockets.Socket.LocalEndPoint" /> property is not set.-or- An operating system error occurs while accessing the <see cref="T:System.Net.Sockets.Socket" />. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller in the call stack does not have the required permissions. </exception>
|
||||
// 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);
|
||||
|
||||
/// <summary>Receives data from a bound <see cref="T:System.Net.Sockets.Socket" /> into the list of receive buffers.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffers">A list of <see cref="T:System.ArraySegment`1" />s of type <see cref="T:System.Byte" /> that contains the received data.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred while attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x06001001 RID: 4097 RVA: 0x0002D744 File Offset: 0x0002B944
|
||||
public int Receive(IList<ArraySegment<byte>> buffers)
|
||||
{
|
||||
SocketError socketError;
|
||||
int num = this.Receive(buffers, SocketFlags.None, out socketError);
|
||||
if (socketError != SocketError.Success)
|
||||
{
|
||||
throw new SocketException((int)socketError);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
/// <summary>Receives data from a bound <see cref="T:System.Net.Sockets.Socket" /> into the list of receive buffers, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffers">A list of <see cref="T:System.ArraySegment`1" />s of type <see cref="T:System.Byte" /> that contains the received data.</param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffers" /> is null.-or-<paramref name="buffers" />.Count is zero.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred while attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x06001002 RID: 4098 RVA: 0x0002D76C File Offset: 0x0002B96C
|
||||
[CLSCompliant(false)]
|
||||
public int Receive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
|
||||
{
|
||||
SocketError socketError;
|
||||
int num = this.Receive(buffers, socketFlags, out socketError);
|
||||
if (socketError != SocketError.Success)
|
||||
{
|
||||
throw new SocketException((int)socketError);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
/// <summary>Receives data from a bound <see cref="T:System.Net.Sockets.Socket" /> into the list of receive buffers, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffers">A list of <see cref="T:System.ArraySegment`1" />s of type <see cref="T:System.Byte" /> that contains the received data.</param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values.</param>
|
||||
/// <param name="errorCode">A <see cref="T:System.Net.Sockets.SocketError" /> object that stores the socket error.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffers" /> is null.-or-<paramref name="buffers" />.Count is zero.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred while attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x06001003 RID: 4099 RVA: 0x0002D794 File Offset: 0x0002B994
|
||||
[CLSCompliant(false)]
|
||||
public int Receive(IList<ArraySegment<byte>> 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<byte> 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins to asynchronously receive data from a specified network device.</summary>
|
||||
/// <returns>Returns true if the I/O operation is pending. The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will not be raised and the <paramref name="e" /> object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.</returns>
|
||||
/// <param name="e">The <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object to use for this asynchronous socket operation.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.RemoteEndPoint" /> cannot be null.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">A socket operation was already in progress using the <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object specified in the <paramref name="e" /> parameter.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows XP or later is required for this method.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. </exception>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Receives a datagram into the data buffer and stores the endpoint.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for received data. </param>
|
||||
/// <param name="remoteEP">An <see cref="T:System.Net.EndPoint" />, passed by reference, that represents the remote server. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.-or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller in the call stack does not have the required permissions. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Receives a datagram into the data buffer, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />, and stores the endpoint.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for the received data. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="remoteEP">An <see cref="T:System.Net.EndPoint" />, passed by reference, that represents the remote server. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.-or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller in the call stack does not have the required permissions. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Receives the specified number of bytes into the data buffer, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />, and stores the endpoint.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for received data. </param>
|
||||
/// <param name="size">The number of bytes to receive. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="remoteEP">An <see cref="T:System.Net.EndPoint" />, passed by reference, that represents the remote server. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.-or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">
|
||||
/// <paramref name="socketFlags" /> is not a valid combination of values.-or- The <see cref="P:System.Net.Sockets.Socket.LocalEndPoint" /> property was not set.-or- An operating system error occurs while accessing the <see cref="T:System.Net.Sockets.Socket" />. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller in the call stack does not have the required permissions. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
|
||||
/// <summary>Receives the specified number of bytes of data into the specified location of the data buffer, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />, and stores the endpoint.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for received data. </param>
|
||||
/// <param name="offset">The position in the <paramref name="buffer" /> parameter to store the received data. </param>
|
||||
/// <param name="size">The number of bytes to receive. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="remoteEP">An <see cref="T:System.Net.EndPoint" />, passed by reference, that represents the remote server. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.-or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of the <paramref name="buffer" /> minus the value of the offset parameter. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">
|
||||
/// <paramref name="socketFlags" /> is not a valid combination of values.-or- The <see cref="P:System.Net.Sockets.Socket.LocalEndPoint" /> property was not set.-or- An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Begins to asynchronously receive the specified number of bytes of data into the specified location in the data buffer, using the specified <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.SocketFlags" />, and stores the endpoint and packet information.</summary>
|
||||
/// <returns>Returns true if the I/O operation is pending. The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will not be raised and the <paramref name="e" /> object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.</returns>
|
||||
/// <param name="e">The <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object to use for this asynchronous socket operation.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.RemoteEndPoint" /> cannot be null.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows XP or later is required for this method.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. </exception>
|
||||
// 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();
|
||||
}
|
||||
|
||||
/// <summary>Receives the specified number of bytes of data into the specified location of the data buffer, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />, and stores the endpoint and packet information.</summary>
|
||||
/// <returns>The number of bytes received.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that is the storage location for received data.</param>
|
||||
/// <param name="offset">The position in the <paramref name="buffer" /> parameter to store the received data.</param>
|
||||
/// <param name="size">The number of bytes to receive.</param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values.</param>
|
||||
/// <param name="remoteEP">An <see cref="T:System.Net.EndPoint" />, passed by reference, that represents the remote server.</param>
|
||||
/// <param name="ipPacketInformation">An <see cref="T:System.Net.Sockets.IPPacketInformation" /> holding address and interface information.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.- or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of the <paramref name="buffer" /> minus the value of the offset parameter. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">
|
||||
/// <paramref name="socketFlags" /> is not a valid combination of values.-or- The <see cref="P:System.Net.Sockets.Socket.LocalEndPoint" /> 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. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The operating system is Windows 2000 or earlier, and this method requires Windows XP.</exception>
|
||||
// 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();
|
||||
}
|
||||
|
||||
/// <summary>Sends a collection of files or in memory data buffers asynchronously to a connected <see cref="T:System.Net.Sockets.Socket" /> object.</summary>
|
||||
/// <returns>Returns true if the I/O operation is pending. The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will not be raised and the <paramref name="e" /> object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.</returns>
|
||||
/// <param name="e">The <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object to use for this asynchronous socket operation.</param>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">The file specified in the <see cref="P:System.Net.Sockets.SendPacketsElement.FilePath" /> property was not found. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">A socket operation was already in progress using the <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object specified in the <paramref name="e" /> parameter.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows XP or later is required for this method. This exception also occurs if the <see cref="T:System.Net.Sockets.Socket" /> is not connected to a remote host. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">A connectionless <see cref="T:System.Net.Sockets.Socket" /> is being used and the file being sent exceeds the maximum packet size of the underlying transport.</exception>
|
||||
// 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();
|
||||
}
|
||||
|
||||
/// <summary>Sends data to a connected <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>The number of bytes sent to the <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to be sent. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Sends data to a connected <see cref="T:System.Net.Sockets.Socket" /> using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes sent to the <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to be sent. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Sends the specified number of bytes of data to a connected <see cref="T:System.Net.Sockets.Socket" />, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes sent to the <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to be sent. </param>
|
||||
/// <param name="size">The number of bytes to send. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="size" /> is less than 0 or exceeds the size of the buffer. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">
|
||||
/// <paramref name="socketFlags" /> is not a valid combination of values.-or- An operating system error occurs while accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Sends the specified number of bytes of data to a connected <see cref="T:System.Net.Sockets.Socket" />, starting at the specified offset, and using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes sent to the <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to be sent. </param>
|
||||
/// <param name="offset">The position in the data buffer at which to begin sending data. </param>
|
||||
/// <param name="size">The number of bytes to send. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">
|
||||
/// <paramref name="socketFlags" /> is not a valid combination of values.-or- An operating system error occurs while accessing the <see cref="T:System.Net.Sockets.Socket" />. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Sends the specified number of bytes of data to a connected <see cref="T:System.Net.Sockets.Socket" />, starting at the specified offset, and using the specified <see cref="T:System.Net.Sockets.SocketFlags" /></summary>
|
||||
/// <returns>The number of bytes sent to the <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to be sent. </param>
|
||||
/// <param name="offset">The position in the data buffer at which to begin sending data. </param>
|
||||
/// <param name="size">The number of bytes to send. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="errorCode">A <see cref="T:System.Net.Sockets.SocketError" /> object that stores the socket error.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">
|
||||
/// <paramref name="socketFlags" /> is not a valid combination of values.-or- An operating system error occurs while accessing the <see cref="T:System.Net.Sockets.Socket" />. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// 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);
|
||||
|
||||
/// <summary>Sends the set of buffers in the list to a connected <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>The number of bytes sent to the <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
/// <param name="buffers">A list of <see cref="T:System.ArraySegment`1" />s of type <see cref="T:System.Byte" /> that contains the data to be sent. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffers" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="buffers" /> is empty.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See remarks section below. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x06001015 RID: 4117 RVA: 0x0002DFBC File Offset: 0x0002C1BC
|
||||
public int Send(IList<ArraySegment<byte>> buffers)
|
||||
{
|
||||
SocketError socketError;
|
||||
int num = this.Send(buffers, SocketFlags.None, out socketError);
|
||||
if (socketError != SocketError.Success)
|
||||
{
|
||||
throw new SocketException((int)socketError);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
/// <summary>Sends the set of buffers in the list to a connected <see cref="T:System.Net.Sockets.Socket" />, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes sent to the <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
/// <param name="buffers">A list of <see cref="T:System.ArraySegment`1" />s of type <see cref="T:System.Byte" /> that contains the data to be sent.</param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffers" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="buffers" /> is empty.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x06001016 RID: 4118 RVA: 0x0002DFE4 File Offset: 0x0002C1E4
|
||||
public int Send(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
|
||||
{
|
||||
SocketError socketError;
|
||||
int num = this.Send(buffers, socketFlags, out socketError);
|
||||
if (socketError != SocketError.Success)
|
||||
{
|
||||
throw new SocketException((int)socketError);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
/// <summary>Sends the set of buffers in the list to a connected <see cref="T:System.Net.Sockets.Socket" />, using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes sent to the <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
/// <param name="buffers">A list of <see cref="T:System.ArraySegment`1" />s of type <see cref="T:System.Byte" /> that contains the data to be sent.</param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values.</param>
|
||||
/// <param name="errorCode">A <see cref="T:System.Net.Sockets.SocketError" /> object that stores the socket error.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffers" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="buffers" /> is empty.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x06001017 RID: 4119 RVA: 0x0002E00C File Offset: 0x0002C20C
|
||||
[CLSCompliant(false)]
|
||||
public int Send(IList<ArraySegment<byte>> 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<byte> 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);
|
||||
|
||||
/// <summary>Sends the file <paramref name="fileName" /> to a connected <see cref="T:System.Net.Sockets.Socket" /> object with the <see cref="F:System.Net.Sockets.TransmitFileOptions.UseDefaultWorkerThread" /> transmit flag.</summary>
|
||||
/// <param name="fileName">A <see cref="T:System.String" /> that contains the path and name of the file to be sent. This parameter can be null. </param>
|
||||
/// <exception cref="T:System.NotSupportedException">The socket is not connected to a remote host. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.Socket" /> object is not in blocking mode and cannot accept this synchronous call. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">The file <paramref name="fileName" /> was not found. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Sends the file <paramref name="fileName" /> and buffers of data to a connected <see cref="T:System.Net.Sockets.Socket" /> object using the specified <see cref="T:System.Net.Sockets.TransmitFileOptions" /> value.</summary>
|
||||
/// <param name="fileName">A <see cref="T:System.String" /> that contains the path and name of the file to be sent. This parameter can be null. </param>
|
||||
/// <param name="preBuffer">A <see cref="T:System.Byte" /> array that contains data to be sent before the file is sent. This parameter can be null. </param>
|
||||
/// <param name="postBuffer">A <see cref="T:System.Byte" /> array that contains data to be sent after the file is sent. This parameter can be null. </param>
|
||||
/// <param name="flags">One or more of <see cref="T:System.Net.Sockets.TransmitFileOptions" /> values. </param>
|
||||
/// <exception cref="T:System.NotSupportedException">The operating system is not Windows NT or later.- or - The socket is not connected to a remote host. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.Socket" /> object is not in blocking mode and cannot accept this synchronous call. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">The file <paramref name="fileName" /> was not found. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Sends data asynchronously to a specific remote host.</summary>
|
||||
/// <returns>Returns true if the I/O operation is pending. The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will not be raised and the <paramref name="e" /> object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.</returns>
|
||||
/// <param name="e">The <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object to use for this asynchronous socket operation.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.RemoteEndPoint" /> cannot be null.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">A socket operation was already in progress using the <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object specified in the <paramref name="e" /> parameter.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows XP or later is required for this method.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">The protocol specified is connection-oriented, but the <see cref="T:System.Net.Sockets.Socket" /> is not yet connected.</exception>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Sends data to the specified endpoint.</summary>
|
||||
/// <returns>The number of bytes sent.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to be sent. </param>
|
||||
/// <param name="remoteEP">The <see cref="T:System.Net.EndPoint" /> that represents the destination for the data. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.-or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Sends data to a specific endpoint using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes sent.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to be sent. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="remoteEP">The <see cref="T:System.Net.EndPoint" /> that represents the destination location for the data. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.-or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Sends the specified number of bytes of data to the specified endpoint using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes sent.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to be sent. </param>
|
||||
/// <param name="size">The number of bytes to send. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="remoteEP">The <see cref="T:System.Net.EndPoint" /> that represents the destination location for the data. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.-or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The specified <paramref name="size" /> exceeds the size of <paramref name="buffer" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Sends the specified number of bytes of data to the specified endpoint, starting at the specified location in the buffer, and using the specified <see cref="T:System.Net.Sockets.SocketFlags" />.</summary>
|
||||
/// <returns>The number of bytes sent.</returns>
|
||||
/// <param name="buffer">An array of type <see cref="T:System.Byte" /> that contains the data to be sent. </param>
|
||||
/// <param name="offset">The position in the data buffer at which to begin sending data. </param>
|
||||
/// <param name="size">The number of bytes to send. </param>
|
||||
/// <param name="socketFlags">A bitwise combination of the <see cref="T:System.Net.Sockets.SocketFlags" /> values. </param>
|
||||
/// <param name="remoteEP">The <see cref="T:System.Net.EndPoint" /> that represents the destination location for the data. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="buffer" /> is null.-or- <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset" /> is less than 0.-or- <paramref name="offset" /> is greater than the length of <paramref name="buffer" />.-or- <paramref name="size" /> is less than 0.-or- <paramref name="size" /> is greater than the length of <paramref name="buffer" /> minus the value of the <paramref name="offset" /> parameter. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">
|
||||
/// <paramref name="socketFlags" /> is not a valid combination of values.-or- An operating system error occurs while accessing the <see cref="T:System.Net.Sockets.Socket" />. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller in the call stack does not have the required permissions. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Sets the specified <see cref="T:System.Net.Sockets.Socket" /> option to the specified value, represented as a byte array.</summary>
|
||||
/// <param name="optionLevel">One of the <see cref="T:System.Net.Sockets.SocketOptionLevel" /> values. </param>
|
||||
/// <param name="optionName">One of the <see cref="T:System.Net.Sockets.SocketOptionName" /> values. </param>
|
||||
/// <param name="optionValue">An array of type <see cref="T:System.Byte" /> that represents the value of the option. </param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Sets the specified <see cref="T:System.Net.Sockets.Socket" /> option to the specified value, represented as an object.</summary>
|
||||
/// <param name="optionLevel">One of the <see cref="T:System.Net.Sockets.SocketOptionLevel" /> values. </param>
|
||||
/// <param name="optionName">One of the <see cref="T:System.Net.Sockets.SocketOptionName" /> values. </param>
|
||||
/// <param name="optionValue">A <see cref="T:System.Net.Sockets.LingerOption" /> or <see cref="T:System.Net.Sockets.MulticastOption" /> that contains the value of the option. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="optionValue" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>Sets the specified <see cref="T:System.Net.Sockets.Socket" /> option to the specified <see cref="T:System.Boolean" /> value.</summary>
|
||||
/// <param name="optionLevel">One of the <see cref="T:System.Net.Sockets.SocketOptionLevel" /> values. </param>
|
||||
/// <param name="optionName">One of the <see cref="T:System.Net.Sockets.SocketOptionName" /> values. </param>
|
||||
/// <param name="optionValue">The value of the option, represented as a <see cref="T:System.Boolean" />. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> object has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether IPv4 support is available and enabled on the current host.</summary>
|
||||
/// <returns>true if the current host supports the IPv4 protocol; otherwise, false.</returns>
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether the Framework supports IPv6 for certain obsolete <see cref="T:System.Net.Dns" /> members.</summary>
|
||||
/// <returns>true if the Framework supports IPv6 for certain obsolete <see cref="T:System.Net.Dns" /> methods; otherwise, false.</returns>
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the underlying operating system and network adaptors support Internet Protocol version 6 (IPv6).</summary>
|
||||
/// <returns>true if the operating system and network adaptors support the IPv6 protocol; otherwise, false.</returns>
|
||||
// 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);
|
||||
|
||||
/// <summary>Frees resources used by the <see cref="T:System.Net.Sockets.Socket" /> class.</summary>
|
||||
// Token: 0x0600102C RID: 4140 RVA: 0x0002E888 File Offset: 0x0002CA88
|
||||
~Socket()
|
||||
{
|
||||
this.Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>Gets the address family of the <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>One of the <see cref="T:System.Net.Sockets.AddressFamily" /> values.</returns>
|
||||
// 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);
|
||||
|
||||
/// <summary>Gets or sets a value that indicates whether the <see cref="T:System.Net.Sockets.Socket" /> is in blocking mode.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.Socket" /> will block; otherwise, false. The default is true.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether a <see cref="T:System.Net.Sockets.Socket" /> is connected to a remote host as of the last <see cref="Overload:System.Net.Sockets.Socket.Send" /> or <see cref="Overload:System.Net.Sockets.Socket.Receive" /> operation.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.Socket" /> was connected to a remote resource as of the most recent operation; otherwise, false.</returns>
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the protocol type of the <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>One of the <see cref="T:System.Net.Sockets.ProtocolType" /> values.</returns>
|
||||
// Token: 0x1700056C RID: 1388
|
||||
// (get) Token: 0x06001033 RID: 4147 RVA: 0x0002E940 File Offset: 0x0002CB40
|
||||
public ProtocolType ProtocolType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.protocol_type;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a <see cref="T:System.Boolean" /> value that specifies whether the stream <see cref="T:System.Net.Sockets.Socket" /> is using the Nagle algorithm.</summary>
|
||||
/// <returns>false if the <see cref="T:System.Net.Sockets.Socket" /> uses the Nagle algorithm; otherwise, true. The default is false.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the <see cref="T:System.Net.Sockets.Socket" />. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that specifies the size of the receive buffer of the <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An <see cref="T:System.Int32" /> that contains the size, in bytes, of the receive buffer. The default is 8192.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The value specified for a set operation is less than 0.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that specifies the size of the send buffer of the <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An <see cref="T:System.Int32" /> that contains the size, in bytes, of the send buffer. The default is 8192.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The value specified for a set operation is less than 0.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that specifies the Time To Live (TTL) value of Internet Protocol (IP) packets sent by the <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>The TTL value.</returns>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The TTL value can't be set to a negative number.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">This property can only be retrieved or set for a socket in the <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /> or <see cref="F:System.Net.Sockets.AddressFamily.InterNetworkV6" /> address family.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">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.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
|
||||
/// <summary>Gets the remote endpoint.</summary>
|
||||
/// <returns>The <see cref="T:System.Net.EndPoint" /> with which the <see cref="T:System.Net.Sockets.Socket" /> is communicating.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Net.Sockets.Socket" />, and optionally disposes of the managed resources.</summary>
|
||||
/// <param name="disposing">true to release both managed and unmanaged resources; false to releases only unmanaged resources. </param>
|
||||
// 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);
|
||||
|
||||
/// <summary>Closes the <see cref="T:System.Net.Sockets.Socket" /> connection and releases all associated resources.</summary>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001042 RID: 4162 RVA: 0x0002EDF8 File Offset: 0x0002CFF8
|
||||
public void Close()
|
||||
{
|
||||
this.linger_timeout = 0;
|
||||
((IDisposable)this).Dispose();
|
||||
}
|
||||
|
||||
/// <summary>Closes the <see cref="T:System.Net.Sockets.Socket" /> connection and releases all associated resources with a specified timeout to allow queued data to be sent.</summary>
|
||||
/// <param name="timeout">Wait up to <paramref name="timeout" /> seconds to send any remaining data, then close the socket.</param>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Establishes a connection to a remote host.</summary>
|
||||
/// <param name="remoteEP">An <see cref="T:System.Net.EndPoint" /> that represents the remote device. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="remoteEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller higher in the call stack does not have permission for the requested operation. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.Socket" /> is <see cref="M:System.Net.Sockets.Socket.Listen(System.Int32)" />ing.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous request to receive data from a connected <see cref="T:System.Net.Sockets.Socket" /> object.</summary>
|
||||
/// <returns>Returns true if the I/O operation is pending. The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will not be raised and the <paramref name="e" /> object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.</returns>
|
||||
/// <param name="e">The <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object to use for this asynchronous socket operation.</param>
|
||||
/// <exception cref="T:System.ArgumentException">An argument was invalid. The <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Buffer" /> or <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.BufferList" /> properties on the <paramref name="e" /> parameter must reference valid buffers. One or the other of these properties may be set, but not both at the same time.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">A socket operation was already in progress using the <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object specified in the <paramref name="e" /> parameter.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows XP or later is required for this method.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Sends data asynchronously to a connected <see cref="T:System.Net.Sockets.Socket" /> object.</summary>
|
||||
/// <returns>Returns true if the I/O operation is pending. The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The <see cref="E:System.Net.Sockets.SocketAsyncEventArgs.Completed" /> event on the <paramref name="e" /> parameter will not be raised and the <paramref name="e" /> object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.</returns>
|
||||
/// <param name="e">The <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object to use for this asynchronous socket operation.</param>
|
||||
/// <exception cref="T:System.ArgumentException">The <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Buffer" /> or <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.BufferList" /> properties on the <paramref name="e" /> parameter must reference valid buffers. One or the other of these properties may be set, but not both at the same time.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">A socket operation was already in progress using the <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> object specified in the <paramref name="e" /> parameter.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Windows XP or later is required for this method.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">The <see cref="T:System.Net.Sockets.Socket" /> is not yet connected or was not obtained via an <see cref="M:System.Net.Sockets.Socket.Accept" />, <see cref="M:System.Net.Sockets.Socket.AcceptAsync(System.Net.Sockets.SocketAsyncEventArgs)" />,or <see cref="Overload:System.Net.Sockets.Socket.BeginAccept" />, method.</exception>
|
||||
// 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;
|
||||
}
|
||||
|
||||
/// <summary>Returns the value of a specified <see cref="T:System.Net.Sockets.Socket" /> option, represented as an object.</summary>
|
||||
/// <returns>An object that represents the value of the option. When the <paramref name="optionName" /> parameter is set to <see cref="F:System.Net.Sockets.SocketOptionName.Linger" /> the return value is an instance of the <see cref="T:System.Net.Sockets.LingerOption" /> class. When <paramref name="optionName" /> is set to <see cref="F:System.Net.Sockets.SocketOptionName.AddMembership" /> or <see cref="F:System.Net.Sockets.SocketOptionName.DropMembership" />, the return value is an instance of the <see cref="T:System.Net.Sockets.MulticastOption" /> class. When <paramref name="optionName" /> is any other value, the return value is an integer.</returns>
|
||||
/// <param name="optionLevel">One of the <see cref="T:System.Net.Sockets.SocketOptionLevel" /> values. </param>
|
||||
/// <param name="optionName">One of the <see cref="T:System.Net.Sockets.SocketOptionName" /> values. </param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information.-or-<paramref name="optionName" /> was set to the unsupported value <see cref="F:System.Net.Sockets.SocketOptionName.MaxConnections" />.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
|
||||
/// <summary>Disables sends and receives on a <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <param name="how">One of the <see cref="T:System.Net.Sockets.SocketShutdown" /> values that specifies the operation that will no longer be allowed. </param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// 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);
|
||||
|
||||
/// <summary>Sets the specified <see cref="T:System.Net.Sockets.Socket" /> option to the specified integer value.</summary>
|
||||
/// <param name="optionLevel">One of the <see cref="T:System.Net.Sockets.SocketOptionLevel" /> values. </param>
|
||||
/// <param name="optionName">One of the <see cref="T:System.Net.Sockets.SocketOptionName" /> values. </param>
|
||||
/// <param name="optionValue">A value of the option. </param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// 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<ArraySegment<byte>> 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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,387 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Represents an asynchronous socket operation.</summary>
|
||||
// Token: 0x020001EA RID: 490
|
||||
public class SocketAsyncEventArgs : EventArgs, IDisposable
|
||||
{
|
||||
// Token: 0x06001084 RID: 4228 RVA: 0x0003018C File Offset: 0x0002E38C
|
||||
internal SocketAsyncEventArgs(bool policy)
|
||||
: this()
|
||||
{
|
||||
this.PolicyRestricted = policy;
|
||||
}
|
||||
|
||||
/// <summary>Creates an empty <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> instance.</summary>
|
||||
/// <exception cref="T:System.NotSupportedException">The platform is not supported. </exception>
|
||||
// Token: 0x06001085 RID: 4229 RVA: 0x0003019C File Offset: 0x0002E39C
|
||||
public SocketAsyncEventArgs()
|
||||
{
|
||||
this.AcceptSocket = null;
|
||||
this.Buffer = null;
|
||||
this.BufferList = null;
|
||||
this.BytesTransferred = 0;
|
||||
this.Count = 0;
|
||||
this.DisconnectReuseSocket = false;
|
||||
this.LastOperation = SocketAsyncOperation.None;
|
||||
this.Offset = 0;
|
||||
this.RemoteEndPoint = null;
|
||||
this.SendPacketsSendSize = -1;
|
||||
this.SocketError = SocketError.Success;
|
||||
this.SocketFlags = SocketFlags.None;
|
||||
this.UserToken = null;
|
||||
}
|
||||
|
||||
/// <summary>The event used to complete an asynchronous operation.</summary>
|
||||
// Token: 0x14000026 RID: 38
|
||||
// (add) Token: 0x06001086 RID: 4230 RVA: 0x0003020C File Offset: 0x0002E40C
|
||||
// (remove) Token: 0x06001087 RID: 4231 RVA: 0x00030228 File Offset: 0x0002E428
|
||||
public event EventHandler<SocketAsyncEventArgs> Completed;
|
||||
|
||||
/// <summary>Gets or sets the socket to use or the socket created for accepting a connection with an asynchronous socket method.</summary>
|
||||
/// <returns>The <see cref="T:System.Net.Sockets.Socket" /> to use or the socket created for accepting a connection with an asynchronous socket method.</returns>
|
||||
// Token: 0x1700057F RID: 1407
|
||||
// (get) Token: 0x06001088 RID: 4232 RVA: 0x00030244 File Offset: 0x0002E444
|
||||
// (set) Token: 0x06001089 RID: 4233 RVA: 0x0003024C File Offset: 0x0002E44C
|
||||
public Socket AcceptSocket { get; set; }
|
||||
|
||||
/// <summary>Gets the data buffer to use with an asynchronous socket method.</summary>
|
||||
/// <returns>A <see cref="T:System.Byte" /> array that represents the data buffer to use with an asynchronous socket method.</returns>
|
||||
// Token: 0x17000580 RID: 1408
|
||||
// (get) Token: 0x0600108A RID: 4234 RVA: 0x00030258 File Offset: 0x0002E458
|
||||
// (set) Token: 0x0600108B RID: 4235 RVA: 0x00030260 File Offset: 0x0002E460
|
||||
public byte[] Buffer { get; private set; }
|
||||
|
||||
/// <summary>Gets or sets an array of data buffers to use with an asynchronous socket method.</summary>
|
||||
/// <returns>An <see cref="T:System.Collections.IList" /> that represents an array of data buffers to use with an asynchronous socket method.</returns>
|
||||
/// <exception cref="T:System.ArgumentException">There are ambiguous buffers specified on a set operation. This exception occurs if a value other than null is passed and the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Buffer" /> property is also not null.</exception>
|
||||
// Token: 0x17000581 RID: 1409
|
||||
// (get) Token: 0x0600108C RID: 4236 RVA: 0x0003026C File Offset: 0x0002E46C
|
||||
// (set) Token: 0x0600108D RID: 4237 RVA: 0x00030274 File Offset: 0x0002E474
|
||||
[global::System.MonoTODO("not supported in all cases")]
|
||||
public IList<ArraySegment<byte>> BufferList
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._bufferList;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.Buffer != null && value != null)
|
||||
{
|
||||
throw new ArgumentException("Buffer and BufferList properties cannot both be non-null.");
|
||||
}
|
||||
this._bufferList = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the number of bytes transferred in the socket operation.</summary>
|
||||
/// <returns>An <see cref="T:System.Int32" /> that contains the number of bytes transferred in the socket operation.</returns>
|
||||
// Token: 0x17000582 RID: 1410
|
||||
// (get) Token: 0x0600108E RID: 4238 RVA: 0x0003029C File Offset: 0x0002E49C
|
||||
// (set) Token: 0x0600108F RID: 4239 RVA: 0x000302A4 File Offset: 0x0002E4A4
|
||||
public int BytesTransferred { get; private set; }
|
||||
|
||||
/// <summary>Gets the maximum amount of data, in bytes, to send or receive in an asynchronous operation.</summary>
|
||||
/// <returns>An <see cref="T:System.Int32" /> that contains the maximum amount of data, in bytes, to send or receive.</returns>
|
||||
// Token: 0x17000583 RID: 1411
|
||||
// (get) Token: 0x06001090 RID: 4240 RVA: 0x000302B0 File Offset: 0x0002E4B0
|
||||
// (set) Token: 0x06001091 RID: 4241 RVA: 0x000302B8 File Offset: 0x0002E4B8
|
||||
public int Count { get; private set; }
|
||||
|
||||
/// <summary>Gets or sets a value that specifies if socket can be reused after a disconnect operation.</summary>
|
||||
/// <returns>A <see cref="T:System.Boolean" /> that specifies if socket can be reused after a disconnect operation.</returns>
|
||||
// Token: 0x17000584 RID: 1412
|
||||
// (get) Token: 0x06001092 RID: 4242 RVA: 0x000302C4 File Offset: 0x0002E4C4
|
||||
// (set) Token: 0x06001093 RID: 4243 RVA: 0x000302CC File Offset: 0x0002E4CC
|
||||
public bool DisconnectReuseSocket { get; set; }
|
||||
|
||||
/// <summary>Gets the type of socket operation most recently performed with this context object.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.SocketAsyncOperation" /> instance that indicates the type of socket operation most recently performed with this context object.</returns>
|
||||
// Token: 0x17000585 RID: 1413
|
||||
// (get) Token: 0x06001094 RID: 4244 RVA: 0x000302D8 File Offset: 0x0002E4D8
|
||||
// (set) Token: 0x06001095 RID: 4245 RVA: 0x000302E0 File Offset: 0x0002E4E0
|
||||
public SocketAsyncOperation LastOperation { get; private set; }
|
||||
|
||||
/// <summary>Gets the offset, in bytes, into the data buffer referenced by the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Buffer" /> property.</summary>
|
||||
/// <returns>An <see cref="T:System.Int32" /> that contains the offset, in bytes, into the data buffer referenced by the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Buffer" /> property.</returns>
|
||||
// Token: 0x17000586 RID: 1414
|
||||
// (get) Token: 0x06001096 RID: 4246 RVA: 0x000302EC File Offset: 0x0002E4EC
|
||||
// (set) Token: 0x06001097 RID: 4247 RVA: 0x000302F4 File Offset: 0x0002E4F4
|
||||
public int Offset { get; private set; }
|
||||
|
||||
/// <summary>Gets or sets the remote IP endpoint for an asynchronous operation.</summary>
|
||||
/// <returns>An <see cref="T:System.Net.EndPoint" /> that represents the remote IP endpoint for an asynchronous operation.</returns>
|
||||
// Token: 0x17000587 RID: 1415
|
||||
// (get) Token: 0x06001098 RID: 4248 RVA: 0x00030300 File Offset: 0x0002E500
|
||||
// (set) Token: 0x06001099 RID: 4249 RVA: 0x00030308 File Offset: 0x0002E508
|
||||
public EndPoint RemoteEndPoint { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the size, in bytes, of the data block used in the send operation.</summary>
|
||||
/// <returns>An <see cref="T:System.Int32" /> that contains the size, in bytes, of the data block used in the send operation.</returns>
|
||||
// Token: 0x17000588 RID: 1416
|
||||
// (get) Token: 0x0600109A RID: 4250 RVA: 0x00030314 File Offset: 0x0002E514
|
||||
// (set) Token: 0x0600109B RID: 4251 RVA: 0x0003031C File Offset: 0x0002E51C
|
||||
[global::System.MonoTODO("unused property")]
|
||||
public int SendPacketsSendSize { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the result of the asynchronous socket operation.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.SocketError" /> that represents the result of the asynchronous socket operation.</returns>
|
||||
// Token: 0x17000589 RID: 1417
|
||||
// (get) Token: 0x0600109C RID: 4252 RVA: 0x00030328 File Offset: 0x0002E528
|
||||
// (set) Token: 0x0600109D RID: 4253 RVA: 0x00030330 File Offset: 0x0002E530
|
||||
public SocketError SocketError { get; set; }
|
||||
|
||||
/// <summary>Gets the results of an asynchronous socket operation or sets the behavior of an asynchronous operation.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.SocketFlags" /> that represents the results of an asynchronous socket operation.</returns>
|
||||
// Token: 0x1700058A RID: 1418
|
||||
// (get) Token: 0x0600109E RID: 4254 RVA: 0x0003033C File Offset: 0x0002E53C
|
||||
// (set) Token: 0x0600109F RID: 4255 RVA: 0x00030344 File Offset: 0x0002E544
|
||||
public SocketFlags SocketFlags { get; set; }
|
||||
|
||||
/// <summary>Gets or sets a user or application object associated with this asynchronous socket operation.</summary>
|
||||
/// <returns>An object that represents the user or application object associated with this asynchronous socket operation.</returns>
|
||||
// Token: 0x1700058B RID: 1419
|
||||
// (get) Token: 0x060010A0 RID: 4256 RVA: 0x00030350 File Offset: 0x0002E550
|
||||
// (set) Token: 0x060010A1 RID: 4257 RVA: 0x00030358 File Offset: 0x0002E558
|
||||
public object UserToken { get; set; }
|
||||
|
||||
// Token: 0x1700058C RID: 1420
|
||||
// (get) Token: 0x060010A2 RID: 4258 RVA: 0x00030364 File Offset: 0x0002E564
|
||||
public Socket ConnectSocket
|
||||
{
|
||||
get
|
||||
{
|
||||
SocketError socketError = this.SocketError;
|
||||
if (socketError != SocketError.AccessDenied)
|
||||
{
|
||||
return this.curSocket;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700058D RID: 1421
|
||||
// (get) Token: 0x060010A3 RID: 4259 RVA: 0x00030390 File Offset: 0x0002E590
|
||||
// (set) Token: 0x060010A4 RID: 4260 RVA: 0x00030398 File Offset: 0x0002E598
|
||||
internal bool PolicyRestricted { get; private set; }
|
||||
|
||||
/// <summary>Frees resources used by the <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> class.</summary>
|
||||
// Token: 0x060010A5 RID: 4261 RVA: 0x000303A4 File Offset: 0x0002E5A4
|
||||
~SocketAsyncEventArgs()
|
||||
{
|
||||
this.Dispose(false);
|
||||
}
|
||||
|
||||
// Token: 0x060010A6 RID: 4262 RVA: 0x000303E0 File Offset: 0x0002E5E0
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
Socket acceptSocket = this.AcceptSocket;
|
||||
if (acceptSocket != null)
|
||||
{
|
||||
acceptSocket.Close();
|
||||
}
|
||||
if (disposing)
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Net.Sockets.SocketAsyncEventArgs" /> instance and optionally disposes of the managed resources.</summary>
|
||||
// Token: 0x060010A7 RID: 4263 RVA: 0x0003040C File Offset: 0x0002E60C
|
||||
public void Dispose()
|
||||
{
|
||||
this.Dispose(true);
|
||||
}
|
||||
|
||||
/// <summary>Represents a method that is called when an asynchronous operation completes.</summary>
|
||||
/// <param name="e">The event that is signaled.</param>
|
||||
// Token: 0x060010A8 RID: 4264 RVA: 0x00030418 File Offset: 0x0002E618
|
||||
protected virtual void OnCompleted(SocketAsyncEventArgs e)
|
||||
{
|
||||
if (e == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
EventHandler<SocketAsyncEventArgs> completed = e.Completed;
|
||||
if (completed != null)
|
||||
{
|
||||
completed(e.curSocket, e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the data buffer to use with an asynchronous socket method.</summary>
|
||||
/// <param name="offset">The offset, in bytes, in the data buffer where the operation starts.</param>
|
||||
/// <param name="count">The maximum amount of data, in bytes, to send or receive in the buffer.</param>
|
||||
/// <exception cref="T:System.ArgumentException">There are ambiguous buffers specified. This exception occurs if the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Buffer" /> property is also not null and the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.BufferList" /> property is also not null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">An argument was out of range. This exception occurs if the <paramref name="offset" /> parameter is less than zero or greater than the length of the array in the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Buffer" /> property. This exception also occurs if the <paramref name="count" /> parameter is less than zero or greater than the length of the array in the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Buffer" /> property minus the <paramref name="offset" /> parameter.</exception>
|
||||
// Token: 0x060010A9 RID: 4265 RVA: 0x00030448 File Offset: 0x0002E648
|
||||
public void SetBuffer(int offset, int count)
|
||||
{
|
||||
this.SetBufferInternal(this.Buffer, offset, count);
|
||||
}
|
||||
|
||||
/// <summary>Sets the data buffer to use with an asynchronous socket method.</summary>
|
||||
/// <param name="buffer">The data buffer to use with an asynchronous socket method.</param>
|
||||
/// <param name="offset">The offset, in bytes, in the data buffer where the operation starts.</param>
|
||||
/// <param name="count">The maximum amount of data, in bytes, to send or receive in the buffer.</param>
|
||||
/// <exception cref="T:System.ArgumentException">There are ambiguous buffers specified. This exception occurs if the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Buffer" /> property is also not null and the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.BufferList" /> property is also not null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">An argument was out of range. This exception occurs if the <paramref name="offset" /> parameter is less than zero or greater than the length of the array in the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Buffer" /> property. This exception also occurs if the <paramref name="count" /> parameter is less than zero or greater than the length of the array in the <see cref="P:System.Net.Sockets.SocketAsyncEventArgs.Buffer" /> property minus the <paramref name="offset" /> parameter.</exception>
|
||||
// Token: 0x060010AA RID: 4266 RVA: 0x00030458 File Offset: 0x0002E658
|
||||
public void SetBuffer(byte[] buffer, int offset, int count)
|
||||
{
|
||||
this.SetBufferInternal(buffer, offset, count);
|
||||
}
|
||||
|
||||
// Token: 0x060010AB RID: 4267 RVA: 0x00030464 File Offset: 0x0002E664
|
||||
private void SetBufferInternal(byte[] buffer, int offset, int count)
|
||||
{
|
||||
if (buffer != null)
|
||||
{
|
||||
if (this.BufferList != null)
|
||||
{
|
||||
throw new ArgumentException("Buffer and BufferList properties cannot both be non-null.");
|
||||
}
|
||||
int num = buffer.Length;
|
||||
if (offset < 0 || (offset != 0 && offset >= num))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset");
|
||||
}
|
||||
if (count < 0 || count > num - offset)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("count");
|
||||
}
|
||||
this.Count = count;
|
||||
this.Offset = offset;
|
||||
}
|
||||
this.Buffer = buffer;
|
||||
}
|
||||
|
||||
// Token: 0x060010AC RID: 4268 RVA: 0x000304E0 File Offset: 0x0002E6E0
|
||||
private void ReceiveCallback()
|
||||
{
|
||||
this.SocketError = SocketError.Success;
|
||||
this.LastOperation = SocketAsyncOperation.Receive;
|
||||
SocketError socketError = SocketError.Success;
|
||||
if (!this.curSocket.Connected)
|
||||
{
|
||||
this.SocketError = SocketError.NotConnected;
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
this.BytesTransferred = this.curSocket.Receive_nochecks(this.Buffer, this.Offset, this.Count, this.SocketFlags, out socketError);
|
||||
}
|
||||
finally
|
||||
{
|
||||
this.SocketError = socketError;
|
||||
this.OnCompleted(this);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060010AD RID: 4269 RVA: 0x00030574 File Offset: 0x0002E774
|
||||
private void ConnectCallback()
|
||||
{
|
||||
this.LastOperation = SocketAsyncOperation.Connect;
|
||||
SocketError socketError = SocketError.AccessDenied;
|
||||
try
|
||||
{
|
||||
socketError = this.TryConnect(this.RemoteEndPoint);
|
||||
}
|
||||
finally
|
||||
{
|
||||
this.SocketError = socketError;
|
||||
this.OnCompleted(this);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060010AE RID: 4270 RVA: 0x000305CC File Offset: 0x0002E7CC
|
||||
private SocketError TryConnect(EndPoint endpoint)
|
||||
{
|
||||
this.curSocket.Connected = false;
|
||||
SocketError socketError = SocketError.Success;
|
||||
try
|
||||
{
|
||||
this.curSocket.seed_endpoint = endpoint;
|
||||
this.curSocket.Connect(endpoint);
|
||||
this.curSocket.Connected = true;
|
||||
}
|
||||
catch (SocketException ex)
|
||||
{
|
||||
socketError = ex.SocketErrorCode;
|
||||
}
|
||||
return socketError;
|
||||
}
|
||||
|
||||
// Token: 0x060010AF RID: 4271 RVA: 0x0003063C File Offset: 0x0002E83C
|
||||
private void SendCallback()
|
||||
{
|
||||
this.SocketError = SocketError.Success;
|
||||
this.LastOperation = SocketAsyncOperation.Send;
|
||||
SocketError socketError = SocketError.Success;
|
||||
if (!this.curSocket.Connected)
|
||||
{
|
||||
this.SocketError = SocketError.NotConnected;
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
if (this.Buffer != null)
|
||||
{
|
||||
this.BytesTransferred = this.curSocket.Send_nochecks(this.Buffer, this.Offset, this.Count, SocketFlags.None, out socketError);
|
||||
}
|
||||
else if (this.BufferList != null)
|
||||
{
|
||||
this.BytesTransferred = 0;
|
||||
foreach (ArraySegment<byte> arraySegment in this.BufferList)
|
||||
{
|
||||
this.BytesTransferred += this.curSocket.Send_nochecks(arraySegment.Array, arraySegment.Offset, arraySegment.Count, SocketFlags.None, out socketError);
|
||||
if (socketError != SocketError.Success)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
this.SocketError = socketError;
|
||||
this.OnCompleted(this);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060010B0 RID: 4272 RVA: 0x00030774 File Offset: 0x0002E974
|
||||
internal void DoOperation(SocketAsyncOperation operation, Socket socket)
|
||||
{
|
||||
this.curSocket = socket;
|
||||
ThreadStart threadStart;
|
||||
switch (operation)
|
||||
{
|
||||
case SocketAsyncOperation.Connect:
|
||||
threadStart = new ThreadStart(this.ConnectCallback);
|
||||
goto IL_6A;
|
||||
case SocketAsyncOperation.Receive:
|
||||
threadStart = new ThreadStart(this.ReceiveCallback);
|
||||
goto IL_6A;
|
||||
case SocketAsyncOperation.Send:
|
||||
threadStart = new ThreadStart(this.SendCallback);
|
||||
goto IL_6A;
|
||||
}
|
||||
throw new NotSupportedException();
|
||||
IL_6A:
|
||||
new Thread(threadStart)
|
||||
{
|
||||
IsBackground = true
|
||||
}.Start();
|
||||
}
|
||||
|
||||
// Token: 0x04000E8D RID: 3725
|
||||
private IList<ArraySegment<byte>> _bufferList;
|
||||
|
||||
// Token: 0x04000E8E RID: 3726
|
||||
private Socket curSocket;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>The type of asynchronous socket operation most recently performed with this context object.</summary>
|
||||
// Token: 0x020001EB RID: 491
|
||||
public enum SocketAsyncOperation
|
||||
{
|
||||
/// <summary>None of the socket operations.</summary>
|
||||
// Token: 0x04000E9E RID: 3742
|
||||
None,
|
||||
/// <summary>A socket Accept operation. </summary>
|
||||
// Token: 0x04000E9F RID: 3743
|
||||
Accept,
|
||||
/// <summary>A socket Connect operation.</summary>
|
||||
// Token: 0x04000EA0 RID: 3744
|
||||
Connect,
|
||||
/// <summary>A socket Disconnect operation.</summary>
|
||||
// Token: 0x04000EA1 RID: 3745
|
||||
Disconnect,
|
||||
/// <summary>A socket Receive operation.</summary>
|
||||
// Token: 0x04000EA2 RID: 3746
|
||||
Receive,
|
||||
/// <summary>A socket ReceiveFrom operation.</summary>
|
||||
// Token: 0x04000EA3 RID: 3747
|
||||
ReceiveFrom,
|
||||
/// <summary>A socket ReceiveMessageFrom operation.</summary>
|
||||
// Token: 0x04000EA4 RID: 3748
|
||||
ReceiveMessageFrom,
|
||||
/// <summary>A socket Send operation.</summary>
|
||||
// Token: 0x04000EA5 RID: 3749
|
||||
Send,
|
||||
/// <summary>A socket SendPackets operation.</summary>
|
||||
// Token: 0x04000EA6 RID: 3750
|
||||
SendPackets,
|
||||
/// <summary>A socket SendTo operation.</summary>
|
||||
// Token: 0x04000EA7 RID: 3751
|
||||
SendTo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Defines error codes for the <see cref="T:System.Net.Sockets.Socket" /> class.</summary>
|
||||
// Token: 0x020001EC RID: 492
|
||||
public enum SocketError
|
||||
{
|
||||
/// <summary>An attempt was made to access a <see cref="T:System.Net.Sockets.Socket" /> in a way that is forbidden by its access permissions.</summary>
|
||||
// Token: 0x04000EA9 RID: 3753
|
||||
AccessDenied = 10013,
|
||||
/// <summary>Only one use of an address is normally permitted.</summary>
|
||||
// Token: 0x04000EAA RID: 3754
|
||||
AddressAlreadyInUse = 10048,
|
||||
/// <summary>The address family specified is not supported. This error is returned if the IPv6 address family was specified and the IPv6 stack is not installed on the local machine. This error is returned if the IPv4 address family was specified and the IPv4 stack is not installed on the local machine.</summary>
|
||||
// Token: 0x04000EAB RID: 3755
|
||||
AddressFamilyNotSupported = 10047,
|
||||
/// <summary>The selected IP address is not valid in this context.</summary>
|
||||
// Token: 0x04000EAC RID: 3756
|
||||
AddressNotAvailable = 10049,
|
||||
/// <summary>The nonblocking <see cref="T:System.Net.Sockets.Socket" /> already has an operation in progress.</summary>
|
||||
// Token: 0x04000EAD RID: 3757
|
||||
AlreadyInProgress = 10037,
|
||||
/// <summary>The connection was aborted by the .NET Framework or the underlying socket provider.</summary>
|
||||
// Token: 0x04000EAE RID: 3758
|
||||
ConnectionAborted = 10053,
|
||||
/// <summary>The remote host is actively refusing a connection.</summary>
|
||||
// Token: 0x04000EAF RID: 3759
|
||||
ConnectionRefused = 10061,
|
||||
/// <summary>The connection was reset by the remote peer.</summary>
|
||||
// Token: 0x04000EB0 RID: 3760
|
||||
ConnectionReset = 10054,
|
||||
/// <summary>A required address was omitted from an operation on a <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
// Token: 0x04000EB1 RID: 3761
|
||||
DestinationAddressRequired = 10039,
|
||||
/// <summary>A graceful shutdown is in progress.</summary>
|
||||
// Token: 0x04000EB2 RID: 3762
|
||||
Disconnecting = 10101,
|
||||
/// <summary>An invalid pointer address was detected by the underlying socket provider.</summary>
|
||||
// Token: 0x04000EB3 RID: 3763
|
||||
Fault = 10014,
|
||||
/// <summary>The operation failed because the remote host is down.</summary>
|
||||
// Token: 0x04000EB4 RID: 3764
|
||||
HostDown = 10064,
|
||||
/// <summary>No such host is known. The name is not an official host name or alias.</summary>
|
||||
// Token: 0x04000EB5 RID: 3765
|
||||
HostNotFound = 11001,
|
||||
/// <summary>There is no network route to the specified host.</summary>
|
||||
// Token: 0x04000EB6 RID: 3766
|
||||
HostUnreachable = 10065,
|
||||
/// <summary>A blocking operation is in progress.</summary>
|
||||
// Token: 0x04000EB7 RID: 3767
|
||||
InProgress = 10036,
|
||||
/// <summary>A blocking <see cref="T:System.Net.Sockets.Socket" /> call was canceled.</summary>
|
||||
// Token: 0x04000EB8 RID: 3768
|
||||
Interrupted = 10004,
|
||||
/// <summary>An invalid argument was supplied to a <see cref="T:System.Net.Sockets.Socket" /> member.</summary>
|
||||
// Token: 0x04000EB9 RID: 3769
|
||||
InvalidArgument = 10022,
|
||||
/// <summary>The application has initiated an overlapped operation that cannot be completed immediately.</summary>
|
||||
// Token: 0x04000EBA RID: 3770
|
||||
IOPending = 997,
|
||||
/// <summary>The <see cref="T:System.Net.Sockets.Socket" /> is already connected.</summary>
|
||||
// Token: 0x04000EBB RID: 3771
|
||||
IsConnected = 10056,
|
||||
/// <summary>The datagram is too long.</summary>
|
||||
// Token: 0x04000EBC RID: 3772
|
||||
MessageSize = 10040,
|
||||
/// <summary>The network is not available.</summary>
|
||||
// Token: 0x04000EBD RID: 3773
|
||||
NetworkDown = 10050,
|
||||
/// <summary>The application tried to set <see cref="F:System.Net.Sockets.SocketOptionName.KeepAlive" /> on a connection that has already timed out.</summary>
|
||||
// Token: 0x04000EBE RID: 3774
|
||||
NetworkReset = 10052,
|
||||
/// <summary>No route to the remote host exists.</summary>
|
||||
// Token: 0x04000EBF RID: 3775
|
||||
NetworkUnreachable = 10051,
|
||||
/// <summary>No free buffer space is available for a <see cref="T:System.Net.Sockets.Socket" /> operation.</summary>
|
||||
// Token: 0x04000EC0 RID: 3776
|
||||
NoBufferSpaceAvailable = 10055,
|
||||
/// <summary>The requested name or IP address was not found on the name server.</summary>
|
||||
// Token: 0x04000EC1 RID: 3777
|
||||
NoData = 11004,
|
||||
/// <summary>The error is unrecoverable or the requested database cannot be located.</summary>
|
||||
// Token: 0x04000EC2 RID: 3778
|
||||
NoRecovery = 11003,
|
||||
/// <summary>The application tried to send or receive data, and the <see cref="T:System.Net.Sockets.Socket" /> is not connected.</summary>
|
||||
// Token: 0x04000EC3 RID: 3779
|
||||
NotConnected = 10057,
|
||||
/// <summary>The underlying socket provider has not been initialized.</summary>
|
||||
// Token: 0x04000EC4 RID: 3780
|
||||
NotInitialized = 10093,
|
||||
/// <summary>A <see cref="T:System.Net.Sockets.Socket" /> operation was attempted on a non-socket.</summary>
|
||||
// Token: 0x04000EC5 RID: 3781
|
||||
NotSocket = 10038,
|
||||
/// <summary>The overlapped operation was aborted due to the closure of the <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
// Token: 0x04000EC6 RID: 3782
|
||||
OperationAborted = 995,
|
||||
/// <summary>The address family is not supported by the protocol family.</summary>
|
||||
// Token: 0x04000EC7 RID: 3783
|
||||
OperationNotSupported = 10045,
|
||||
/// <summary>Too many processes are using the underlying socket provider.</summary>
|
||||
// Token: 0x04000EC8 RID: 3784
|
||||
ProcessLimit = 10067,
|
||||
/// <summary>The protocol family is not implemented or has not been configured.</summary>
|
||||
// Token: 0x04000EC9 RID: 3785
|
||||
ProtocolFamilyNotSupported = 10046,
|
||||
/// <summary>The protocol is not implemented or has not been configured.</summary>
|
||||
// Token: 0x04000ECA RID: 3786
|
||||
ProtocolNotSupported = 10043,
|
||||
/// <summary>An unknown, invalid, or unsupported option or level was used with a <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
// Token: 0x04000ECB RID: 3787
|
||||
ProtocolOption = 10042,
|
||||
/// <summary>The protocol type is incorrect for this <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
// Token: 0x04000ECC RID: 3788
|
||||
ProtocolType = 10041,
|
||||
/// <summary>A request to send or receive data was disallowed because the <see cref="T:System.Net.Sockets.Socket" /> has already been closed.</summary>
|
||||
// Token: 0x04000ECD RID: 3789
|
||||
Shutdown = 10058,
|
||||
/// <summary>An unspecified <see cref="T:System.Net.Sockets.Socket" /> error has occurred.</summary>
|
||||
// Token: 0x04000ECE RID: 3790
|
||||
SocketError = -1,
|
||||
/// <summary>The support for the specified socket type does not exist in this address family.</summary>
|
||||
// Token: 0x04000ECF RID: 3791
|
||||
SocketNotSupported = 10044,
|
||||
/// <summary>The <see cref="T:System.Net.Sockets.Socket" /> operation succeeded.</summary>
|
||||
// Token: 0x04000ED0 RID: 3792
|
||||
Success = 0,
|
||||
/// <summary>The network subsystem is unavailable.</summary>
|
||||
// Token: 0x04000ED1 RID: 3793
|
||||
SystemNotReady = 10091,
|
||||
/// <summary>The connection attempt timed out, or the connected host has failed to respond.</summary>
|
||||
// Token: 0x04000ED2 RID: 3794
|
||||
TimedOut = 10060,
|
||||
/// <summary>There are too many open sockets in the underlying socket provider.</summary>
|
||||
// Token: 0x04000ED3 RID: 3795
|
||||
TooManyOpenSockets = 10024,
|
||||
/// <summary>The name of the host could not be resolved. Try again later.</summary>
|
||||
// Token: 0x04000ED4 RID: 3796
|
||||
TryAgain = 11002,
|
||||
/// <summary>The specified class was not found.</summary>
|
||||
// Token: 0x04000ED5 RID: 3797
|
||||
TypeNotFound = 10109,
|
||||
/// <summary>The version of the underlying socket provider is out of range.</summary>
|
||||
// Token: 0x04000ED6 RID: 3798
|
||||
VersionNotSupported = 10092,
|
||||
/// <summary>An operation on a nonblocking socket cannot be completed immediately.</summary>
|
||||
// Token: 0x04000ED7 RID: 3799
|
||||
WouldBlock = 10035
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>The exception that is thrown when a socket error occurs.</summary>
|
||||
// Token: 0x020001ED RID: 493
|
||||
[Serializable]
|
||||
public class SocketException : global::System.ComponentModel.Win32Exception
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SocketException" /> class with the last operating system error code.</summary>
|
||||
// Token: 0x060010B1 RID: 4273 RVA: 0x00030800 File Offset: 0x0002EA00
|
||||
public SocketException()
|
||||
: base(SocketException.WSAGetLastError_internal())
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SocketException" /> class with the specified error code.</summary>
|
||||
/// <param name="errorCode">The error code that indicates the error that occurred. </param>
|
||||
// Token: 0x060010B2 RID: 4274 RVA: 0x00030810 File Offset: 0x0002EA10
|
||||
public SocketException(int error)
|
||||
: base(error)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.SocketException" /> class from the specified instances of the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> and <see cref="T:System.Runtime.Serialization.StreamingContext" /> classes.</summary>
|
||||
/// <param name="serializationInfo">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> instance that contains the information that is required to serialize the new <see cref="T:System.Net.Sockets.SocketException" /> instance. </param>
|
||||
/// <param name="streamingContext">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains the source of the serialized stream that is associated with the new <see cref="T:System.Net.Sockets.SocketException" /> instance. </param>
|
||||
// Token: 0x060010B3 RID: 4275 RVA: 0x0003081C File Offset: 0x0002EA1C
|
||||
protected SocketException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x060010B4 RID: 4276 RVA: 0x00030828 File Offset: 0x0002EA28
|
||||
internal SocketException(int error, string message)
|
||||
: base(error, message)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x060010B5 RID: 4277
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern int WSAGetLastError_internal();
|
||||
|
||||
/// <summary>Gets the error code that is associated with this exception.</summary>
|
||||
/// <returns>An integer error code that is associated with this exception.</returns>
|
||||
// Token: 0x1700058E RID: 1422
|
||||
// (get) Token: 0x060010B6 RID: 4278 RVA: 0x00030834 File Offset: 0x0002EA34
|
||||
public override int ErrorCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.NativeErrorCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the error code that is associated with this exception.</summary>
|
||||
/// <returns>An integer error code that is associated with this exception.</returns>
|
||||
// Token: 0x1700058F RID: 1423
|
||||
// (get) Token: 0x060010B7 RID: 4279 RVA: 0x0003083C File Offset: 0x0002EA3C
|
||||
public SocketError SocketErrorCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return (SocketError)base.NativeErrorCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the error message that is associated with this exception.</summary>
|
||||
/// <returns>A string that contains the error message. </returns>
|
||||
// Token: 0x17000590 RID: 1424
|
||||
// (get) Token: 0x060010B8 RID: 4280 RVA: 0x00030844 File Offset: 0x0002EA44
|
||||
public override string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Message;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Specifies socket send and receive behaviors.</summary>
|
||||
// Token: 0x020001EE RID: 494
|
||||
[Flags]
|
||||
public enum SocketFlags
|
||||
{
|
||||
/// <summary>Use no flags for this call.</summary>
|
||||
// Token: 0x04000ED9 RID: 3801
|
||||
None = 0,
|
||||
/// <summary>Process out-of-band data.</summary>
|
||||
// Token: 0x04000EDA RID: 3802
|
||||
OutOfBand = 1,
|
||||
/// <summary>Peek at the incoming message.</summary>
|
||||
// Token: 0x04000EDB RID: 3803
|
||||
Peek = 2,
|
||||
/// <summary>Send without using routing tables.</summary>
|
||||
// Token: 0x04000EDC RID: 3804
|
||||
DontRoute = 4,
|
||||
/// <summary>Provides a standard value for the number of WSABUF structures that are used to send and receive data.</summary>
|
||||
// Token: 0x04000EDD RID: 3805
|
||||
MaxIOVectorLength = 16,
|
||||
/// <summary>The message was too large to fit into the specified buffer and was truncated.</summary>
|
||||
// Token: 0x04000EDE RID: 3806
|
||||
Truncated = 256,
|
||||
/// <summary>Indicates that the control data did not fit into an internal 64-KB buffer and was truncated.</summary>
|
||||
// Token: 0x04000EDF RID: 3807
|
||||
ControlDataTruncated = 512,
|
||||
/// <summary>Indicates a broadcast packet.</summary>
|
||||
// Token: 0x04000EE0 RID: 3808
|
||||
Broadcast = 1024,
|
||||
/// <summary>Indicates a multicast packet.</summary>
|
||||
// Token: 0x04000EE1 RID: 3809
|
||||
Multicast = 2048,
|
||||
/// <summary>Partial send or receive for message.</summary>
|
||||
// Token: 0x04000EE2 RID: 3810
|
||||
Partial = 32768
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Encapsulates the information that is necessary to duplicate a <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
// Token: 0x020001EF RID: 495
|
||||
[Serializable]
|
||||
public struct SocketInformation
|
||||
{
|
||||
/// <summary>Gets or sets the options for a <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.SocketInformationOptions" /> instance.</returns>
|
||||
// Token: 0x17000591 RID: 1425
|
||||
// (get) Token: 0x060010B9 RID: 4281 RVA: 0x0003084C File Offset: 0x0002EA4C
|
||||
// (set) Token: 0x060010BA RID: 4282 RVA: 0x00030854 File Offset: 0x0002EA54
|
||||
public SocketInformationOptions Options
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.options;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.options = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the protocol information for a <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>An array of type <see cref="T:System.Byte" />.</returns>
|
||||
// Token: 0x17000592 RID: 1426
|
||||
// (get) Token: 0x060010BB RID: 4283 RVA: 0x00030860 File Offset: 0x0002EA60
|
||||
// (set) Token: 0x060010BC RID: 4284 RVA: 0x00030868 File Offset: 0x0002EA68
|
||||
public byte[] ProtocolInformation
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.protocol_info;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.protocol_info = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000EE3 RID: 3811
|
||||
private SocketInformationOptions options;
|
||||
|
||||
// Token: 0x04000EE4 RID: 3812
|
||||
private byte[] protocol_info;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Describes states for a <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
// Token: 0x020001F0 RID: 496
|
||||
[Flags]
|
||||
public enum SocketInformationOptions
|
||||
{
|
||||
/// <summary>The <see cref="T:System.Net.Sockets.Socket" /> is nonblocking.</summary>
|
||||
// Token: 0x04000EE6 RID: 3814
|
||||
NonBlocking = 1,
|
||||
/// <summary>The <see cref="T:System.Net.Sockets.Socket" /> is connected.</summary>
|
||||
// Token: 0x04000EE7 RID: 3815
|
||||
Connected = 2,
|
||||
/// <summary>The <see cref="T:System.Net.Sockets.Socket" /> is listening for new connections.</summary>
|
||||
// Token: 0x04000EE8 RID: 3816
|
||||
Listening = 4,
|
||||
/// <summary>The <see cref="T:System.Net.Sockets.Socket" /> uses overlapped I/O.</summary>
|
||||
// Token: 0x04000EE9 RID: 3817
|
||||
UseOnlyOverlappedIO = 8
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Defines socket option levels for the <see cref="M:System.Net.Sockets.Socket.SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Int32)" /> and <see cref="M:System.Net.Sockets.Socket.GetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName)" /> methods.</summary>
|
||||
// Token: 0x020001F1 RID: 497
|
||||
public enum SocketOptionLevel
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="T:System.Net.Sockets.Socket" /> options apply to all sockets.</summary>
|
||||
// Token: 0x04000EEB RID: 3819
|
||||
Socket = 65535,
|
||||
/// <summary>
|
||||
/// <see cref="T:System.Net.Sockets.Socket" /> options apply only to IP sockets.</summary>
|
||||
// Token: 0x04000EEC RID: 3820
|
||||
IP = 0,
|
||||
/// <summary>
|
||||
/// <see cref="T:System.Net.Sockets.Socket" /> options apply only to IPv6 sockets.</summary>
|
||||
// Token: 0x04000EED RID: 3821
|
||||
IPv6 = 41,
|
||||
/// <summary>
|
||||
/// <see cref="T:System.Net.Sockets.Socket" /> options apply only to TCP sockets.</summary>
|
||||
// Token: 0x04000EEE RID: 3822
|
||||
Tcp = 6,
|
||||
/// <summary>
|
||||
/// <see cref="T:System.Net.Sockets.Socket" /> options apply only to UDP sockets.</summary>
|
||||
// Token: 0x04000EEF RID: 3823
|
||||
Udp = 17
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Defines configuration option names.</summary>
|
||||
// Token: 0x020001F2 RID: 498
|
||||
public enum SocketOptionName
|
||||
{
|
||||
/// <summary>Record debugging information.</summary>
|
||||
// Token: 0x04000EF1 RID: 3825
|
||||
Debug = 1,
|
||||
/// <summary>The socket is listening.</summary>
|
||||
// Token: 0x04000EF2 RID: 3826
|
||||
AcceptConnection,
|
||||
/// <summary>Allows the socket to be bound to an address that is already in use.</summary>
|
||||
// Token: 0x04000EF3 RID: 3827
|
||||
ReuseAddress = 4,
|
||||
/// <summary>Use keep-alives.</summary>
|
||||
// Token: 0x04000EF4 RID: 3828
|
||||
KeepAlive = 8,
|
||||
/// <summary>Do not route; send the packet directly to the interface addresses.</summary>
|
||||
// Token: 0x04000EF5 RID: 3829
|
||||
DontRoute = 16,
|
||||
/// <summary>Permit sending broadcast messages on the socket.</summary>
|
||||
// Token: 0x04000EF6 RID: 3830
|
||||
Broadcast = 32,
|
||||
/// <summary>Bypass hardware when possible.</summary>
|
||||
// Token: 0x04000EF7 RID: 3831
|
||||
UseLoopback = 64,
|
||||
/// <summary>Linger on close if unsent data is present.</summary>
|
||||
// Token: 0x04000EF8 RID: 3832
|
||||
Linger = 128,
|
||||
/// <summary>Receives out-of-band data in the normal data stream.</summary>
|
||||
// Token: 0x04000EF9 RID: 3833
|
||||
OutOfBandInline = 256,
|
||||
/// <summary>Close the socket gracefully without lingering.</summary>
|
||||
// Token: 0x04000EFA RID: 3834
|
||||
DontLinger = -129,
|
||||
/// <summary>Enables a socket to be bound for exclusive access.</summary>
|
||||
// Token: 0x04000EFB RID: 3835
|
||||
ExclusiveAddressUse = -5,
|
||||
/// <summary>Specifies the total per-socket buffer space reserved for sends. This is unrelated to the maximum message size or the size of a TCP window.</summary>
|
||||
// Token: 0x04000EFC RID: 3836
|
||||
SendBuffer = 4097,
|
||||
/// <summary>Specifies the total per-socket buffer space reserved for receives. This is unrelated to the maximum message size or the size of a TCP window.</summary>
|
||||
// Token: 0x04000EFD RID: 3837
|
||||
ReceiveBuffer,
|
||||
/// <summary>Specifies the low water mark for <see cref="Overload:System.Net.Sockets.Socket.Send" /> operations.</summary>
|
||||
// Token: 0x04000EFE RID: 3838
|
||||
SendLowWater,
|
||||
/// <summary>Specifies the low water mark for <see cref="Overload:System.Net.Sockets.Socket.Receive" /> operations.</summary>
|
||||
// Token: 0x04000EFF RID: 3839
|
||||
ReceiveLowWater,
|
||||
/// <summary>Send a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the <see cref="M:System.Net.Sockets.Socket.BeginSend(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object)" /> method.</summary>
|
||||
// Token: 0x04000F00 RID: 3840
|
||||
SendTimeout,
|
||||
/// <summary>Receive a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the <see cref="M:System.Net.Sockets.Socket.BeginSend(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object)" /> method.</summary>
|
||||
// Token: 0x04000F01 RID: 3841
|
||||
ReceiveTimeout,
|
||||
/// <summary>Get the error status and clear.</summary>
|
||||
// Token: 0x04000F02 RID: 3842
|
||||
Error,
|
||||
/// <summary>Get the socket type.</summary>
|
||||
// Token: 0x04000F03 RID: 3843
|
||||
Type,
|
||||
/// <summary>Not supported; will throw a <see cref="T:System.Net.Sockets.SocketException" /> if used.</summary>
|
||||
// Token: 0x04000F04 RID: 3844
|
||||
MaxConnections = 2147483647,
|
||||
/// <summary>Specifies the IP options to be inserted into outgoing datagrams.</summary>
|
||||
// Token: 0x04000F05 RID: 3845
|
||||
IPOptions = 1,
|
||||
/// <summary>Indicates that the application provides the IP header for outgoing datagrams.</summary>
|
||||
// Token: 0x04000F06 RID: 3846
|
||||
HeaderIncluded,
|
||||
/// <summary>Change the IP header type of the service field.</summary>
|
||||
// Token: 0x04000F07 RID: 3847
|
||||
TypeOfService,
|
||||
/// <summary>Set the IP header Time-to-Live field.</summary>
|
||||
// Token: 0x04000F08 RID: 3848
|
||||
IpTimeToLive,
|
||||
/// <summary>Set the interface for outgoing multicast packets.</summary>
|
||||
// Token: 0x04000F09 RID: 3849
|
||||
MulticastInterface = 9,
|
||||
/// <summary>An IP multicast Time to Live.</summary>
|
||||
// Token: 0x04000F0A RID: 3850
|
||||
MulticastTimeToLive,
|
||||
/// <summary>An IP multicast loopback.</summary>
|
||||
// Token: 0x04000F0B RID: 3851
|
||||
MulticastLoopback,
|
||||
/// <summary>Add an IP group membership.</summary>
|
||||
// Token: 0x04000F0C RID: 3852
|
||||
AddMembership,
|
||||
/// <summary>Drop an IP group membership.</summary>
|
||||
// Token: 0x04000F0D RID: 3853
|
||||
DropMembership,
|
||||
/// <summary>Do not fragment IP datagrams.</summary>
|
||||
// Token: 0x04000F0E RID: 3854
|
||||
DontFragment,
|
||||
/// <summary>Join a source group.</summary>
|
||||
// Token: 0x04000F0F RID: 3855
|
||||
AddSourceMembership,
|
||||
/// <summary>Drop a source group.</summary>
|
||||
// Token: 0x04000F10 RID: 3856
|
||||
DropSourceMembership,
|
||||
/// <summary>Block data from a source.</summary>
|
||||
// Token: 0x04000F11 RID: 3857
|
||||
BlockSource,
|
||||
/// <summary>Unblock a previously blocked source.</summary>
|
||||
// Token: 0x04000F12 RID: 3858
|
||||
UnblockSource,
|
||||
/// <summary>Return information about received packets.</summary>
|
||||
// Token: 0x04000F13 RID: 3859
|
||||
PacketInformation,
|
||||
/// <summary>Disables the Nagle algorithm for send coalescing.</summary>
|
||||
// Token: 0x04000F14 RID: 3860
|
||||
NoDelay = 1,
|
||||
/// <summary>Use urgent data as defined in RFC-1222. This option can be set only once; after it is set, it cannot be turned off.</summary>
|
||||
// Token: 0x04000F15 RID: 3861
|
||||
BsdUrgent,
|
||||
/// <summary>Use expedited data as defined in RFC-1222. This option can be set only once; after it is set, it cannot be turned off.</summary>
|
||||
// Token: 0x04000F16 RID: 3862
|
||||
Expedited = 2,
|
||||
/// <summary>Send UDP datagrams with checksum set to zero.</summary>
|
||||
// Token: 0x04000F17 RID: 3863
|
||||
NoChecksum = 1,
|
||||
/// <summary>Set or get the UDP checksum coverage.</summary>
|
||||
// Token: 0x04000F18 RID: 3864
|
||||
ChecksumCoverage = 20,
|
||||
/// <summary>Specifies the maximum number of router hops for an Internet Protocol version 6 (IPv6) packet. This is similar to Time to Live (TTL) for Internet Protocol version 4.</summary>
|
||||
// Token: 0x04000F19 RID: 3865
|
||||
HopLimit,
|
||||
/// <summary>Updates an accepted socket's properties by using those of an existing socket. This is equivalent to using the Winsock2 SO_UPDATE_ACCEPT_CONTEXT socket option and is supported only on connection-oriented sockets.</summary>
|
||||
// Token: 0x04000F1A RID: 3866
|
||||
UpdateAcceptContext = 28683,
|
||||
/// <summary>Updates a connected socket's properties by using those of an existing socket. This is equivalent to using the Winsock2 SO_UPDATE_CONNECT_CONTEXT socket option and is supported only on connection-oriented sockets.</summary>
|
||||
// Token: 0x04000F1B RID: 3867
|
||||
UpdateConnectContext = 28688
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
// Token: 0x020001F3 RID: 499
|
||||
internal static class SocketPolicyClient
|
||||
{
|
||||
// Token: 0x060010BE RID: 4286 RVA: 0x00030878 File Offset: 0x0002EA78
|
||||
private static void Log(string msg)
|
||||
{
|
||||
Console.WriteLine(string.Concat(new object[]
|
||||
{
|
||||
"SocketPolicyClient",
|
||||
SocketPolicyClient.session,
|
||||
": ",
|
||||
msg
|
||||
}));
|
||||
}
|
||||
|
||||
// Token: 0x060010BF RID: 4287 RVA: 0x000308AC File Offset: 0x0002EAAC
|
||||
private static Stream GetPolicyStreamForIP(string ip, int policyport, int timeout)
|
||||
{
|
||||
SocketPolicyClient.session++;
|
||||
SocketPolicyClient.Log("Incoming GetPolicyStreamForIP");
|
||||
IPEndPoint ipendPoint = new IPEndPoint(IPAddress.Parse(ip), policyport);
|
||||
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
byte[] array = new byte[5000];
|
||||
MemoryStream memoryStream = new MemoryStream();
|
||||
try
|
||||
{
|
||||
SocketPolicyClient.Log("About to BeginConnect to " + ipendPoint);
|
||||
IAsyncResult asyncResult = socket.BeginConnect(ipendPoint, null, null, false);
|
||||
SocketPolicyClient.Log("About to WaitOne");
|
||||
DateTime now = DateTime.Now;
|
||||
if (!asyncResult.AsyncWaitHandle.WaitOne(timeout))
|
||||
{
|
||||
SocketPolicyClient.Log("WaitOne timed out. Duration: " + (DateTime.Now - now).TotalMilliseconds);
|
||||
socket.Close();
|
||||
throw new Exception("BeginConnect timed out");
|
||||
}
|
||||
socket.EndConnect(asyncResult);
|
||||
SocketPolicyClient.Log("Socket connected");
|
||||
byte[] bytes = Encoding.ASCII.GetBytes("<policy-file-request/>\0");
|
||||
SocketError socketError;
|
||||
socket.Send_nochecks(bytes, 0, bytes.Length, SocketFlags.None, out socketError);
|
||||
if (socketError != SocketError.Success)
|
||||
{
|
||||
SocketPolicyClient.Log("Socket error: " + socketError);
|
||||
return memoryStream;
|
||||
}
|
||||
int num = socket.Receive_nochecks(array, 0, array.Length, SocketFlags.None, out socketError);
|
||||
if (socketError != SocketError.Success)
|
||||
{
|
||||
SocketPolicyClient.Log("Socket error: " + socketError);
|
||||
return memoryStream;
|
||||
}
|
||||
try
|
||||
{
|
||||
socket.Shutdown(SocketShutdown.Both);
|
||||
socket.Close();
|
||||
}
|
||||
catch (SocketException)
|
||||
{
|
||||
}
|
||||
memoryStream = new MemoryStream(array, 0, num);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SocketPolicyClient.Log("Caught exception: " + ex.Message);
|
||||
return memoryStream;
|
||||
}
|
||||
memoryStream.Seek(0L, SeekOrigin.Begin);
|
||||
return memoryStream;
|
||||
}
|
||||
|
||||
// Token: 0x04000F1C RID: 3868
|
||||
private const string policy_request = "<policy-file-request/>\0";
|
||||
|
||||
// Token: 0x04000F1D RID: 3869
|
||||
private static int session;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Defines constants that are used by the <see cref="M:System.Net.Sockets.Socket.Shutdown(System.Net.Sockets.SocketShutdown)" /> method.</summary>
|
||||
// Token: 0x020001F4 RID: 500
|
||||
public enum SocketShutdown
|
||||
{
|
||||
/// <summary>Disables a <see cref="T:System.Net.Sockets.Socket" /> for receiving. This field is constant.</summary>
|
||||
// Token: 0x04000F1F RID: 3871
|
||||
Receive,
|
||||
/// <summary>Disables a <see cref="T:System.Net.Sockets.Socket" /> for sending. This field is constant.</summary>
|
||||
// Token: 0x04000F20 RID: 3872
|
||||
Send,
|
||||
/// <summary>Disables a <see cref="T:System.Net.Sockets.Socket" /> for both sending and receiving. This field is constant.</summary>
|
||||
// Token: 0x04000F21 RID: 3873
|
||||
Both
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Specifies the type of socket that an instance of the <see cref="T:System.Net.Sockets.Socket" /> class represents.</summary>
|
||||
// Token: 0x020001F5 RID: 501
|
||||
public enum SocketType
|
||||
{
|
||||
/// <summary>Supports reliable, two-way, connection-based byte streams without the duplication of data and without preservation of boundaries. A Socket of this type communicates with a single peer and requires a remote host connection before communication can begin. <see cref="F:System.Net.Sockets.SocketType.Stream" /> uses the Transmission Control Protocol (<see cref="F:System.Net.Sockets.ProtocolType.Tcp" />) <see cref="T:System.Net.Sockets.ProtocolType" /> and the InterNetwork<see cref="T:System.Net.Sockets.AddressFamily" />.</summary>
|
||||
// Token: 0x04000F23 RID: 3875
|
||||
Stream = 1,
|
||||
/// <summary>Supports datagrams, which are connectionless, unreliable messages of a fixed (typically small) maximum length. Messages might be lost or duplicated and might arrive out of order. A <see cref="T:System.Net.Sockets.Socket" /> of type <see cref="F:System.Net.Sockets.SocketType.Dgram" /> requires no connection prior to sending and receiving data, and can communicate with multiple peers. <see cref="F:System.Net.Sockets.SocketType.Dgram" /> uses the Datagram Protocol (<see cref="F:System.Net.Sockets.ProtocolType.Udp" />) and the <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /><see cref="T:System.Net.Sockets.AddressFamily" />.</summary>
|
||||
// Token: 0x04000F24 RID: 3876
|
||||
Dgram,
|
||||
/// <summary>Supports access to the underlying transport protocol. Using the <see cref="T:System.Net.Sockets.SocketType" /><see cref="F:System.Net.Sockets.SocketType.Raw" />, you can communicate using protocols like Internet Control Message Protocol (<see cref="F:System.Net.Sockets.ProtocolType.Icmp" />) and Internet Group Management Protocol (<see cref="F:System.Net.Sockets.ProtocolType.Igmp" />). Your application must provide a complete IP header when sending. Received datagrams return with the IP header and options intact.</summary>
|
||||
// Token: 0x04000F25 RID: 3877
|
||||
Raw,
|
||||
/// <summary>Supports connectionless, message-oriented, reliably delivered messages, and preserves message boundaries in data. Rdm (Reliably Delivered Messages) messages arrive unduplicated and in order. Furthermore, the sender is notified if messages are lost. If you initialize a Socket using <see cref="F:System.Net.Sockets.SocketType.Rdm" />, you do not require a remote host connection before sending and receiving data. With <see cref="F:System.Net.Sockets.SocketType.Rdm" />, you can communicate with multiple peers.</summary>
|
||||
// Token: 0x04000F26 RID: 3878
|
||||
Rdm,
|
||||
/// <summary>Provides connection-oriented and reliable two-way transfer of ordered byte streams across a network. <see cref="F:System.Net.Sockets.SocketType.Seqpacket" /> does not duplicate data, and it preserves boundaries within the data stream. A Socket of type <see cref="F:System.Net.Sockets.SocketType.Seqpacket" /> communicates with a single peer and requires a remote host connection before communication can begin.</summary>
|
||||
// Token: 0x04000F27 RID: 3879
|
||||
Seqpacket,
|
||||
/// <summary>Specifies an unknown Socket type.</summary>
|
||||
// Token: 0x04000F28 RID: 3880
|
||||
Unknown = -1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,754 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Provides client connections for TCP network services.</summary>
|
||||
// Token: 0x020001F6 RID: 502
|
||||
public class TcpClient : IDisposable
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.TcpClient" /> class.</summary>
|
||||
// Token: 0x060010C0 RID: 4288 RVA: 0x00030A8C File Offset: 0x0002EC8C
|
||||
public TcpClient()
|
||||
{
|
||||
this.Init(AddressFamily.InterNetwork);
|
||||
this.client.Bind(new IPEndPoint(IPAddress.Any, 0));
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.TcpClient" /> class with the specified family.</summary>
|
||||
/// <param name="family">The <see cref="P:System.Net.IPAddress.AddressFamily" /> of the IP protocol. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="family" /> parameter is not equal to AddressFamily.InterNetwork -or- The <paramref name="family" /> parameter is not equal to AddressFamily.InterNetworkV6 </exception>
|
||||
// Token: 0x060010C1 RID: 4289 RVA: 0x00030AB4 File Offset: 0x0002ECB4
|
||||
public TcpClient(AddressFamily family)
|
||||
{
|
||||
if (family != AddressFamily.InterNetwork && family != AddressFamily.InterNetworkV6)
|
||||
{
|
||||
throw new ArgumentException("Family must be InterNetwork or InterNetworkV6", "family");
|
||||
}
|
||||
this.Init(family);
|
||||
IPAddress ipaddress = IPAddress.Any;
|
||||
if (family == AddressFamily.InterNetworkV6)
|
||||
{
|
||||
ipaddress = IPAddress.IPv6Any;
|
||||
}
|
||||
this.client.Bind(new IPEndPoint(ipaddress, 0));
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.TcpClient" /> class and binds it to the specified local endpoint.</summary>
|
||||
/// <param name="localEP">The <see cref="T:System.Net.IPEndPoint" /> to which you bind the TCP <see cref="T:System.Net.Sockets.Socket" />. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="localEP" /> parameter is null. </exception>
|
||||
// Token: 0x060010C2 RID: 4290 RVA: 0x00030B14 File Offset: 0x0002ED14
|
||||
public TcpClient(IPEndPoint local_end_point)
|
||||
{
|
||||
this.Init(local_end_point.AddressFamily);
|
||||
this.client.Bind(local_end_point);
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.TcpClient" /> class and connects to the specified port on the specified host.</summary>
|
||||
/// <param name="hostname">The DNS name of the remote host to which you intend to connect. </param>
|
||||
/// <param name="port">The port number of the remote host to which you intend to connect. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="hostname" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="port" /> parameter is not between <see cref="F:System.Net.IPEndPoint.MinPort" /> and <see cref="F:System.Net.IPEndPoint.MaxPort" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
// Token: 0x060010C3 RID: 4291 RVA: 0x00030B40 File Offset: 0x0002ED40
|
||||
public TcpClient(string hostname, int port)
|
||||
{
|
||||
this.Connect(hostname, port);
|
||||
}
|
||||
|
||||
/// <summary>Releases all resources used by the <see cref="T:System.Net.Sockets.TcpClient" />. </summary>
|
||||
// Token: 0x060010C4 RID: 4292 RVA: 0x00030B50 File Offset: 0x0002ED50
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
this.Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
// Token: 0x060010C5 RID: 4293 RVA: 0x00030B60 File Offset: 0x0002ED60
|
||||
private void Init(AddressFamily family)
|
||||
{
|
||||
this.active = false;
|
||||
if (this.client != null)
|
||||
{
|
||||
this.client.Close();
|
||||
this.client = null;
|
||||
}
|
||||
this.client = new Socket(family, SocketType.Stream, ProtocolType.Tcp);
|
||||
}
|
||||
|
||||
/// <summary>Gets or set a value that indicates whether a connection has been made.</summary>
|
||||
/// <returns>true if the connection has been made; otherwise, false.</returns>
|
||||
// Token: 0x17000593 RID: 1427
|
||||
// (get) Token: 0x060010C6 RID: 4294 RVA: 0x00030BA0 File Offset: 0x0002EDA0
|
||||
// (set) Token: 0x060010C7 RID: 4295 RVA: 0x00030BA8 File Offset: 0x0002EDA8
|
||||
protected bool Active
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.active;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.active = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the underlying <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>The underlying network <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
// Token: 0x17000594 RID: 1428
|
||||
// (get) Token: 0x060010C8 RID: 4296 RVA: 0x00030BB4 File Offset: 0x0002EDB4
|
||||
// (set) Token: 0x060010C9 RID: 4297 RVA: 0x00030BBC File Offset: 0x0002EDBC
|
||||
public Socket Client
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.client;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.client = value;
|
||||
this.stream = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the amount of data that has been received from the network and is available to be read.</summary>
|
||||
/// <returns>The number of bytes of data received from the network and available to be read.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x17000595 RID: 1429
|
||||
// (get) Token: 0x060010CA RID: 4298 RVA: 0x00030BCC File Offset: 0x0002EDCC
|
||||
public int Available
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.client.Available;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether the underlying <see cref="T:System.Net.Sockets.Socket" /> for a <see cref="T:System.Net.Sockets.TcpClient" /> is connected to a remote host.</summary>
|
||||
/// <returns>true if the <see cref="P:System.Net.Sockets.TcpClient.Client" /> socket was connected to a remote resource as of the most recent operation; otherwise, false.</returns>
|
||||
// Token: 0x17000596 RID: 1430
|
||||
// (get) Token: 0x060010CB RID: 4299 RVA: 0x00030BDC File Offset: 0x0002EDDC
|
||||
public bool Connected
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.client.Connected;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a <see cref="T:System.Boolean" /> value that specifies whether the <see cref="T:System.Net.Sockets.TcpClient" /> allows only one client to use a port.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.TcpClient" /> allows only one client to use a specific port; otherwise, false. The default is true for Windows Server 2003 and Windows XP Service Pack 2 and later, and false for all other versions.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the underlying socket.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x17000597 RID: 1431
|
||||
// (get) Token: 0x060010CC RID: 4300 RVA: 0x00030BEC File Offset: 0x0002EDEC
|
||||
// (set) Token: 0x060010CD RID: 4301 RVA: 0x00030BFC File Offset: 0x0002EDFC
|
||||
public bool ExclusiveAddressUse
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.client.ExclusiveAddressUse;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.client.ExclusiveAddressUse = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060010CE RID: 4302 RVA: 0x00030C0C File Offset: 0x0002EE0C
|
||||
internal void SetTcpClient(Socket s)
|
||||
{
|
||||
this.Client = s;
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets information on the linger state of the associated socket.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.LingerOption" />. By default, lingering is disabled.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x17000598 RID: 1432
|
||||
// (get) Token: 0x060010CF RID: 4303 RVA: 0x00030C18 File Offset: 0x0002EE18
|
||||
// (set) Token: 0x060010D0 RID: 4304 RVA: 0x00030C54 File Offset: 0x0002EE54
|
||||
public LingerOption LingerState
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.values & TcpClient.Properties.LingerState) != (TcpClient.Properties)0U)
|
||||
{
|
||||
return this.linger_state;
|
||||
}
|
||||
return (LingerOption)this.client.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!this.client.Connected)
|
||||
{
|
||||
this.linger_state = value;
|
||||
this.values |= TcpClient.Properties.LingerState;
|
||||
return;
|
||||
}
|
||||
this.client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that disables a delay when send or receive buffers are not full.</summary>
|
||||
/// <returns>true if the delay is disabled, otherwise false. The default value is false.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x17000599 RID: 1433
|
||||
// (get) Token: 0x060010D1 RID: 4305 RVA: 0x00030CA0 File Offset: 0x0002EEA0
|
||||
// (set) Token: 0x060010D2 RID: 4306 RVA: 0x00030CD4 File Offset: 0x0002EED4
|
||||
public bool NoDelay
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.values & TcpClient.Properties.NoDelay) != (TcpClient.Properties)0U)
|
||||
{
|
||||
return this.no_delay;
|
||||
}
|
||||
return (bool)this.client.GetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.Debug);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!this.client.Connected)
|
||||
{
|
||||
this.no_delay = value;
|
||||
this.values |= TcpClient.Properties.NoDelay;
|
||||
return;
|
||||
}
|
||||
this.client.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.Debug, (!value) ? 0 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the size of the receive buffer.</summary>
|
||||
/// <returns>The size of the receive buffer, in bytes. The default value is 8192 bytes.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when setting the buffer size.-or-In .NET Compact Framework applications, you cannot set this property. For a workaround, see the Platform Note in Remarks.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x1700059A RID: 1434
|
||||
// (get) Token: 0x060010D3 RID: 4307 RVA: 0x00030D24 File Offset: 0x0002EF24
|
||||
// (set) Token: 0x060010D4 RID: 4308 RVA: 0x00030D60 File Offset: 0x0002EF60
|
||||
public int ReceiveBufferSize
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.values & TcpClient.Properties.ReceiveBufferSize) != (TcpClient.Properties)0U)
|
||||
{
|
||||
return this.recv_buffer_size;
|
||||
}
|
||||
return (int)this.client.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!this.client.Connected)
|
||||
{
|
||||
this.recv_buffer_size = value;
|
||||
this.values |= TcpClient.Properties.ReceiveBufferSize;
|
||||
return;
|
||||
}
|
||||
this.client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the amount of time a <see cref="T:System.Net.Sockets.TcpClient" /> will wait to receive data once a read operation is initiated.</summary>
|
||||
/// <returns>The time-out value of the connection in milliseconds. The default value is 0.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x1700059B RID: 1435
|
||||
// (get) Token: 0x060010D5 RID: 4309 RVA: 0x00030DAC File Offset: 0x0002EFAC
|
||||
// (set) Token: 0x060010D6 RID: 4310 RVA: 0x00030DE8 File Offset: 0x0002EFE8
|
||||
public int ReceiveTimeout
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.values & TcpClient.Properties.ReceiveTimeout) != (TcpClient.Properties)0U)
|
||||
{
|
||||
return this.recv_timeout;
|
||||
}
|
||||
return (int)this.client.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!this.client.Connected)
|
||||
{
|
||||
this.recv_timeout = value;
|
||||
this.values |= TcpClient.Properties.ReceiveTimeout;
|
||||
return;
|
||||
}
|
||||
this.client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the size of the send buffer.</summary>
|
||||
/// <returns>The size of the send buffer, in bytes. The default value is 8192 bytes.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x1700059C RID: 1436
|
||||
// (get) Token: 0x060010D7 RID: 4311 RVA: 0x00030E34 File Offset: 0x0002F034
|
||||
// (set) Token: 0x060010D8 RID: 4312 RVA: 0x00030E68 File Offset: 0x0002F068
|
||||
public int SendBufferSize
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.values & TcpClient.Properties.SendBufferSize) != (TcpClient.Properties)0U)
|
||||
{
|
||||
return this.send_buffer_size;
|
||||
}
|
||||
return (int)this.client.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!this.client.Connected)
|
||||
{
|
||||
this.send_buffer_size = value;
|
||||
this.values |= TcpClient.Properties.SendBufferSize;
|
||||
return;
|
||||
}
|
||||
this.client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the amount of time a <see cref="T:System.Net.Sockets.TcpClient" /> will wait for a send operation to complete successfully.</summary>
|
||||
/// <returns>The send time-out value, in milliseconds. The default is 0.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x1700059D RID: 1437
|
||||
// (get) Token: 0x060010D9 RID: 4313 RVA: 0x00030EA8 File Offset: 0x0002F0A8
|
||||
// (set) Token: 0x060010DA RID: 4314 RVA: 0x00030EDC File Offset: 0x0002F0DC
|
||||
public int SendTimeout
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.values & TcpClient.Properties.SendTimeout) != (TcpClient.Properties)0U)
|
||||
{
|
||||
return this.send_timeout;
|
||||
}
|
||||
return (int)this.client.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!this.client.Connected)
|
||||
{
|
||||
this.send_timeout = value;
|
||||
this.values |= TcpClient.Properties.SendTimeout;
|
||||
return;
|
||||
}
|
||||
this.client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Disposes this <see cref="T:System.Net.Sockets.TcpClient" /> instance and requests that the underlying TCP connection be closed.</summary>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010DB RID: 4315 RVA: 0x00030F1C File Offset: 0x0002F11C
|
||||
public void Close()
|
||||
{
|
||||
((IDisposable)this).Dispose();
|
||||
}
|
||||
|
||||
/// <summary>Connects the client to a remote TCP host using the specified remote network endpoint.</summary>
|
||||
/// <param name="remoteEP">The <see cref="T:System.Net.IPEndPoint" /> to which you intend to connect. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="remoteEp" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.TcpClient" /> is closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010DC RID: 4316 RVA: 0x00030F24 File Offset: 0x0002F124
|
||||
public void Connect(IPEndPoint remote_end_point)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.client.Connect(remote_end_point);
|
||||
this.active = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
this.CheckDisposed();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Connects the client to a remote TCP host using the specified IP address and port number.</summary>
|
||||
/// <param name="address">The <see cref="T:System.Net.IPAddress" /> of the host to which you intend to connect. </param>
|
||||
/// <param name="port">The port number to which you intend to connect. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="address" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="port" /> is not between <see cref="F:System.Net.IPEndPoint.MinPort" /> and <see cref="F:System.Net.IPEndPoint.MaxPort" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">
|
||||
/// <see cref="T:System.Net.Sockets.TcpClient" /> is closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010DD RID: 4317 RVA: 0x00030F6C File Offset: 0x0002F16C
|
||||
public void Connect(IPAddress address, int port)
|
||||
{
|
||||
this.Connect(new IPEndPoint(address, port));
|
||||
}
|
||||
|
||||
// Token: 0x060010DE RID: 4318 RVA: 0x00030F7C File Offset: 0x0002F17C
|
||||
private void SetOptions()
|
||||
{
|
||||
TcpClient.Properties properties = this.values;
|
||||
this.values = (TcpClient.Properties)0U;
|
||||
if ((properties & TcpClient.Properties.LingerState) != (TcpClient.Properties)0U)
|
||||
{
|
||||
this.LingerState = this.linger_state;
|
||||
}
|
||||
if ((properties & TcpClient.Properties.NoDelay) != (TcpClient.Properties)0U)
|
||||
{
|
||||
this.NoDelay = this.no_delay;
|
||||
}
|
||||
if ((properties & TcpClient.Properties.ReceiveBufferSize) != (TcpClient.Properties)0U)
|
||||
{
|
||||
this.ReceiveBufferSize = this.recv_buffer_size;
|
||||
}
|
||||
if ((properties & TcpClient.Properties.ReceiveTimeout) != (TcpClient.Properties)0U)
|
||||
{
|
||||
this.ReceiveTimeout = this.recv_timeout;
|
||||
}
|
||||
if ((properties & TcpClient.Properties.SendBufferSize) != (TcpClient.Properties)0U)
|
||||
{
|
||||
this.SendBufferSize = this.send_buffer_size;
|
||||
}
|
||||
if ((properties & TcpClient.Properties.SendTimeout) != (TcpClient.Properties)0U)
|
||||
{
|
||||
this.SendTimeout = this.send_timeout;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Connects the client to the specified port on the specified host.</summary>
|
||||
/// <param name="hostname">The DNS name of the remote host to which you intend to connect. </param>
|
||||
/// <param name="port">The port number of the remote host to which you intend to connect. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="hostname" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="port" /> parameter is not between <see cref="F:System.Net.IPEndPoint.MinPort" /> and <see cref="F:System.Net.IPEndPoint.MaxPort" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">
|
||||
/// <see cref="T:System.Net.Sockets.TcpClient" /> is closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010DF RID: 4319 RVA: 0x00031014 File Offset: 0x0002F214
|
||||
public void Connect(string hostname, int port)
|
||||
{
|
||||
IPAddress[] hostAddresses = Dns.GetHostAddresses(hostname);
|
||||
this.Connect(hostAddresses, port);
|
||||
}
|
||||
|
||||
/// <summary>Connects the client to a remote TCP host using the specified IP addresses and port number.</summary>
|
||||
/// <param name="ipAddresses">The <see cref="T:System.Net.IPAddress" /> array of the host to which you intend to connect.</param>
|
||||
/// <param name="port">The port number to which you intend to connect.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="ipAddresses" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The port number is not valid.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller higher in the call stack does not have permission for the requested operation. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">This method is valid for sockets that use the <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /> flag or the <see cref="F:System.Net.Sockets.AddressFamily.InterNetworkV6" /> flag.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010E0 RID: 4320 RVA: 0x00031030 File Offset: 0x0002F230
|
||||
public void Connect(IPAddress[] ipAddresses, int port)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (ipAddresses == null)
|
||||
{
|
||||
throw new ArgumentNullException("ipAddresses");
|
||||
}
|
||||
for (int i = 0; i < ipAddresses.Length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
IPAddress ipaddress = ipAddresses[i];
|
||||
if (ipaddress.Equals(IPAddress.Any) || ipaddress.Equals(IPAddress.IPv6Any))
|
||||
{
|
||||
throw new SocketException(10049);
|
||||
}
|
||||
this.Init(ipaddress.AddressFamily);
|
||||
if (ipaddress.AddressFamily == AddressFamily.InterNetwork)
|
||||
{
|
||||
this.client.Bind(new IPEndPoint(IPAddress.Any, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ipaddress.AddressFamily != AddressFamily.InterNetworkV6)
|
||||
{
|
||||
throw new NotSupportedException("This method is only valid for sockets in the InterNetwork and InterNetworkV6 families");
|
||||
}
|
||||
this.client.Bind(new IPEndPoint(IPAddress.IPv6Any, 0));
|
||||
}
|
||||
this.Connect(new IPEndPoint(ipaddress, port));
|
||||
if (this.values != (TcpClient.Properties)0U)
|
||||
{
|
||||
this.SetOptions();
|
||||
}
|
||||
break;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.Init(AddressFamily.InterNetwork);
|
||||
if (i == ipAddresses.Length - 1)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Asynchronously accepts an incoming connection attempt.</summary>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> object returned by a call to <see cref="Overload:System.Net.Sockets.TcpClient.BeginConnect" />.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="asyncResult" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="asyncResult" /> parameter was not returned by a call to a <see cref="Overload:System.Net.Sockets.TcpClient.BeginConnect" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="M:System.Net.Sockets.TcpClient.EndConnect(System.IAsyncResult)" /> method was previously called for the asynchronous connection. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the <see cref="T:System.Net.Sockets.Socket" />. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010E1 RID: 4321 RVA: 0x0003115C File Offset: 0x0002F35C
|
||||
public void EndConnect(IAsyncResult asyncResult)
|
||||
{
|
||||
this.client.EndConnect(asyncResult);
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous request for a remote host connection. The remote host is specified by an <see cref="T:System.Net.IPAddress" /> and a port number (<see cref="T:System.Int32" />).</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that references the asynchronous connection.</returns>
|
||||
/// <param name="address">The <see cref="T:System.Net.IPAddress" /> of the remote host.</param>
|
||||
/// <param name="port">The port number of the remote host.</param>
|
||||
/// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete. </param>
|
||||
/// <param name="state">A user-defined object that contains information about the connect operation. This object is passed to the <paramref name="requestCallback" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="address" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller higher in the call stack does not have permission for the requested operation. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The port number is not valid.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010E2 RID: 4322 RVA: 0x0003116C File Offset: 0x0002F36C
|
||||
public IAsyncResult BeginConnect(IPAddress address, int port, AsyncCallback callback, object state)
|
||||
{
|
||||
return this.client.BeginConnect(address, port, callback, state);
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous request for a remote host connection. The remote host is specified by an <see cref="T:System.Net.IPAddress" /> array and a port number (<see cref="T:System.Int32" />).</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that references the asynchronous connection.</returns>
|
||||
/// <param name="addresses">At least one <see cref="T:System.Net.IPAddress" /> that designates the remote hosts.</param>
|
||||
/// <param name="port">The port number of the remote hosts.</param>
|
||||
/// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete.</param>
|
||||
/// <param name="state">A user-defined object that contains information about the connect operation. This object is passed to the <paramref name="requestCallback" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="addresses" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller higher in the call stack does not have permission for the requested operation. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The port number is not valid.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010E3 RID: 4323 RVA: 0x00031180 File Offset: 0x0002F380
|
||||
public IAsyncResult BeginConnect(IPAddress[] addresses, int port, AsyncCallback callback, object state)
|
||||
{
|
||||
return this.client.BeginConnect(addresses, port, callback, state);
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous request for a remote host connection. The remote host is specified by a host name (<see cref="T:System.String" />) and a port number (<see cref="T:System.Int32" />).</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that references the asynchronous connection.</returns>
|
||||
/// <param name="host">The name of the remote host.</param>
|
||||
/// <param name="port">The port number of the remote host.</param>
|
||||
/// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete.</param>
|
||||
/// <param name="state">A user-defined object that contains information about the connect operation. This object is passed to the <paramref name="requestCallback" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="host" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Security.SecurityException">A caller higher in the call stack does not have permission for the requested operation. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The port number is not valid.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010E4 RID: 4324 RVA: 0x00031194 File Offset: 0x0002F394
|
||||
public IAsyncResult BeginConnect(string host, int port, AsyncCallback callback, object state)
|
||||
{
|
||||
return this.client.BeginConnect(host, port, callback, state);
|
||||
}
|
||||
|
||||
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Net.Sockets.TcpClient" /> and optionally releases the managed resources.</summary>
|
||||
/// <param name="disposing">Set to true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
|
||||
// Token: 0x060010E5 RID: 4325 RVA: 0x000311A8 File Offset: 0x0002F3A8
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (this.disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.disposed = true;
|
||||
if (disposing)
|
||||
{
|
||||
NetworkStream networkStream = this.stream;
|
||||
this.stream = null;
|
||||
if (networkStream != null)
|
||||
{
|
||||
networkStream.Close();
|
||||
this.active = false;
|
||||
}
|
||||
else if (this.client != null)
|
||||
{
|
||||
this.client.Close();
|
||||
this.client = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Frees resources used by the <see cref="T:System.Net.Sockets.TcpClient" /> class.</summary>
|
||||
// Token: 0x060010E6 RID: 4326 RVA: 0x00031214 File Offset: 0x0002F414
|
||||
~TcpClient()
|
||||
{
|
||||
this.Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>Returns the <see cref="T:System.Net.Sockets.NetworkStream" /> used to send and receive data.</summary>
|
||||
/// <returns>The underlying <see cref="T:System.Net.Sockets.NetworkStream" />.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.TcpClient" /> is not connected to a remote host. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.TcpClient" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010E7 RID: 4327 RVA: 0x00031250 File Offset: 0x0002F450
|
||||
public NetworkStream GetStream()
|
||||
{
|
||||
NetworkStream networkStream;
|
||||
try
|
||||
{
|
||||
if (this.stream == null)
|
||||
{
|
||||
this.stream = new NetworkStream(this.client, true);
|
||||
}
|
||||
networkStream = this.stream;
|
||||
}
|
||||
finally
|
||||
{
|
||||
this.CheckDisposed();
|
||||
}
|
||||
return networkStream;
|
||||
}
|
||||
|
||||
// Token: 0x060010E8 RID: 4328 RVA: 0x000312B0 File Offset: 0x0002F4B0
|
||||
private void CheckDisposed()
|
||||
{
|
||||
if (this.disposed)
|
||||
{
|
||||
throw new ObjectDisposedException(base.GetType().FullName);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000F29 RID: 3881
|
||||
private NetworkStream stream;
|
||||
|
||||
// Token: 0x04000F2A RID: 3882
|
||||
private bool active;
|
||||
|
||||
// Token: 0x04000F2B RID: 3883
|
||||
private Socket client;
|
||||
|
||||
// Token: 0x04000F2C RID: 3884
|
||||
private bool disposed;
|
||||
|
||||
// Token: 0x04000F2D RID: 3885
|
||||
private TcpClient.Properties values;
|
||||
|
||||
// Token: 0x04000F2E RID: 3886
|
||||
private int recv_timeout;
|
||||
|
||||
// Token: 0x04000F2F RID: 3887
|
||||
private int send_timeout;
|
||||
|
||||
// Token: 0x04000F30 RID: 3888
|
||||
private int recv_buffer_size;
|
||||
|
||||
// Token: 0x04000F31 RID: 3889
|
||||
private int send_buffer_size;
|
||||
|
||||
// Token: 0x04000F32 RID: 3890
|
||||
private LingerOption linger_state;
|
||||
|
||||
// Token: 0x04000F33 RID: 3891
|
||||
private bool no_delay;
|
||||
|
||||
// Token: 0x020001F7 RID: 503
|
||||
private enum Properties : uint
|
||||
{
|
||||
// Token: 0x04000F35 RID: 3893
|
||||
LingerState = 1U,
|
||||
// Token: 0x04000F36 RID: 3894
|
||||
NoDelay,
|
||||
// Token: 0x04000F37 RID: 3895
|
||||
ReceiveBufferSize = 4U,
|
||||
// Token: 0x04000F38 RID: 3896
|
||||
ReceiveTimeout = 8U,
|
||||
// Token: 0x04000F39 RID: 3897
|
||||
SendBufferSize = 16U,
|
||||
// Token: 0x04000F3A RID: 3898
|
||||
SendTimeout = 32U
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,373 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Listens for connections from TCP network clients.</summary>
|
||||
// Token: 0x020001F8 RID: 504
|
||||
public class TcpListener
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.TcpListener" /> class that listens on the specified port.</summary>
|
||||
/// <param name="port">The port on which to listen for incoming connection attempts. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="port" /> is not between <see cref="F:System.Net.IPEndPoint.MinPort" /> and <see cref="F:System.Net.IPEndPoint.MaxPort" />. </exception>
|
||||
// Token: 0x060010E9 RID: 4329 RVA: 0x000312D0 File Offset: 0x0002F4D0
|
||||
[Obsolete("Use TcpListener (IPAddress address, int port) instead")]
|
||||
public TcpListener(int port)
|
||||
{
|
||||
if (port < 0 || port > 65535)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("port");
|
||||
}
|
||||
this.Init(AddressFamily.InterNetwork, new IPEndPoint(IPAddress.Any, port));
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.TcpListener" /> class with the specified local endpoint.</summary>
|
||||
/// <param name="localEP">An <see cref="T:System.Net.IPEndPoint" /> that represents the local endpoint to which to bind the listener <see cref="T:System.Net.Sockets.Socket" />. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="localEP" /> is null. </exception>
|
||||
// Token: 0x060010EA RID: 4330 RVA: 0x00031308 File Offset: 0x0002F508
|
||||
public TcpListener(IPEndPoint local_end_point)
|
||||
{
|
||||
if (local_end_point == null)
|
||||
{
|
||||
throw new ArgumentNullException("local_end_point");
|
||||
}
|
||||
this.Init(local_end_point.AddressFamily, local_end_point);
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.TcpListener" /> class that listens for incoming connection attempts on the specified local IP address and port number.</summary>
|
||||
/// <param name="localaddr">An <see cref="T:System.Net.IPAddress" /> that represents the local IP address. </param>
|
||||
/// <param name="port">The port on which to listen for incoming connection attempts. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="localaddr" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="port" /> is not between <see cref="F:System.Net.IPEndPoint.MinPort" /> and <see cref="F:System.Net.IPEndPoint.MaxPort" />. </exception>
|
||||
// Token: 0x060010EB RID: 4331 RVA: 0x0003133C File Offset: 0x0002F53C
|
||||
public TcpListener(IPAddress listen_ip, int port)
|
||||
{
|
||||
if (listen_ip == null)
|
||||
{
|
||||
throw new ArgumentNullException("listen_ip");
|
||||
}
|
||||
if (port < 0 || port > 65535)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("port");
|
||||
}
|
||||
this.Init(listen_ip.AddressFamily, new IPEndPoint(listen_ip, port));
|
||||
}
|
||||
|
||||
// Token: 0x060010EC RID: 4332 RVA: 0x00031390 File Offset: 0x0002F590
|
||||
private void Init(AddressFamily family, EndPoint ep)
|
||||
{
|
||||
this.active = false;
|
||||
this.server = new Socket(family, SocketType.Stream, ProtocolType.Tcp);
|
||||
this.savedEP = ep;
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether <see cref="T:System.Net.Sockets.TcpListener" /> is actively listening for client connections.</summary>
|
||||
/// <returns>true if <see cref="T:System.Net.Sockets.TcpListener" /> is actively listening; otherwise, false.</returns>
|
||||
// Token: 0x1700059E RID: 1438
|
||||
// (get) Token: 0x060010ED RID: 4333 RVA: 0x000313B0 File Offset: 0x0002F5B0
|
||||
protected bool Active
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.active;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the underlying <see cref="T:System.Net.EndPoint" /> of the current <see cref="T:System.Net.Sockets.TcpListener" />.</summary>
|
||||
/// <returns>The <see cref="T:System.Net.EndPoint" /> to which the <see cref="T:System.Net.Sockets.Socket" /> is bound.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x1700059F RID: 1439
|
||||
// (get) Token: 0x060010EE RID: 4334 RVA: 0x000313B8 File Offset: 0x0002F5B8
|
||||
public EndPoint LocalEndpoint
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.active)
|
||||
{
|
||||
return this.server.LocalEndPoint;
|
||||
}
|
||||
return this.savedEP;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the underlying network <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>The underlying <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
// Token: 0x170005A0 RID: 1440
|
||||
// (get) Token: 0x060010EF RID: 4335 RVA: 0x000313D8 File Offset: 0x0002F5D8
|
||||
public Socket Server
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.server;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a <see cref="T:System.Boolean" /> value that specifies whether the <see cref="T:System.Net.Sockets.TcpListener" /> allows only one underlying socket to listen to a specific port.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.TcpListener" /> allows only one <see cref="T:System.Net.Sockets.TcpListener" /> to listen to a specific port; otherwise, false. . The default is true for Windows Server 2003 and Windows XP Service Pack 2 and later, and false for all other versions.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.TcpListener" /> has been started. Call the <see cref="M:System.Net.Sockets.TcpListener.Stop" /> method and then set the <see cref="P:System.Net.Sockets.Socket.ExclusiveAddressUse" /> property.</exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the underlying socket.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170005A1 RID: 1441
|
||||
// (get) Token: 0x060010F0 RID: 4336 RVA: 0x000313E0 File Offset: 0x0002F5E0
|
||||
// (set) Token: 0x060010F1 RID: 4337 RVA: 0x00031420 File Offset: 0x0002F620
|
||||
public bool ExclusiveAddressUse
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.server == null)
|
||||
{
|
||||
throw new ObjectDisposedException(base.GetType().ToString());
|
||||
}
|
||||
if (this.active)
|
||||
{
|
||||
throw new InvalidOperationException("The TcpListener has been started");
|
||||
}
|
||||
return this.server.ExclusiveAddressUse;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.server == null)
|
||||
{
|
||||
throw new ObjectDisposedException(base.GetType().ToString());
|
||||
}
|
||||
if (this.active)
|
||||
{
|
||||
throw new InvalidOperationException("The TcpListener has been started");
|
||||
}
|
||||
this.server.ExclusiveAddressUse = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Accepts a pending connection request.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.Socket" /> used to send and receive data.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The listener has not been started with a call to <see cref="M:System.Net.Sockets.TcpListener.Start" />. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010F2 RID: 4338 RVA: 0x0003146C File Offset: 0x0002F66C
|
||||
public Socket AcceptSocket()
|
||||
{
|
||||
if (!this.active)
|
||||
{
|
||||
throw new InvalidOperationException("Socket is not listening");
|
||||
}
|
||||
return this.server.Accept();
|
||||
}
|
||||
|
||||
/// <summary>Accepts a pending connection request </summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.TcpClient" /> used to send and receive data.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The listener has not been started with a call to <see cref="M:System.Net.Sockets.TcpListener.Start" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">Use the <see cref="P:System.Net.Sockets.SocketException.ErrorCode" /> property to obtain the specific error code. When you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010F3 RID: 4339 RVA: 0x00031490 File Offset: 0x0002F690
|
||||
public TcpClient AcceptTcpClient()
|
||||
{
|
||||
if (!this.active)
|
||||
{
|
||||
throw new InvalidOperationException("Socket is not listening");
|
||||
}
|
||||
Socket socket = this.server.Accept();
|
||||
TcpClient tcpClient = new TcpClient();
|
||||
tcpClient.SetTcpClient(socket);
|
||||
return tcpClient;
|
||||
}
|
||||
|
||||
/// <summary>Frees resources used by the <see cref="T:System.Net.Sockets.TcpListener" /> class.</summary>
|
||||
// Token: 0x060010F4 RID: 4340 RVA: 0x000314D0 File Offset: 0x0002F6D0
|
||||
~TcpListener()
|
||||
{
|
||||
if (this.active)
|
||||
{
|
||||
this.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Determines if there are pending connection requests.</summary>
|
||||
/// <returns>true if connections are pending; otherwise, false.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The listener has not been started with a call to <see cref="M:System.Net.Sockets.TcpListener.Start" />. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010F5 RID: 4341 RVA: 0x00031518 File Offset: 0x0002F718
|
||||
public bool Pending()
|
||||
{
|
||||
if (!this.active)
|
||||
{
|
||||
throw new InvalidOperationException("Socket is not listening");
|
||||
}
|
||||
return this.server.Poll(0, SelectMode.SelectRead);
|
||||
}
|
||||
|
||||
/// <summary>Starts listening for incoming connection requests.</summary>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">Use the <see cref="P:System.Net.Sockets.SocketException.ErrorCode" /> property to obtain the specific error code. When you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010F6 RID: 4342 RVA: 0x00031540 File Offset: 0x0002F740
|
||||
public void Start()
|
||||
{
|
||||
this.Start(5);
|
||||
}
|
||||
|
||||
/// <summary>Starts listening for incoming connection requests with a maximum number of pending connection.</summary>
|
||||
/// <param name="backlog">The maximum length of the pending connections queue.</param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred while accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The<paramref name=" backlog" /> parameter is less than zero or exceeds the maximum number of permitted connections.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The underlying <see cref="T:System.Net.Sockets.Socket" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010F7 RID: 4343 RVA: 0x0003154C File Offset: 0x0002F74C
|
||||
public void Start(int backlog)
|
||||
{
|
||||
if (this.active)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this.server == null)
|
||||
{
|
||||
throw new InvalidOperationException("Invalid server socket");
|
||||
}
|
||||
this.server.Bind(this.savedEP);
|
||||
this.server.Listen(backlog);
|
||||
this.active = true;
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous operation to accept an incoming connection attempt.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous creation of the <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
/// <param name="callback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete.</param>
|
||||
/// <param name="state">A user-defined object containing information about the accept operation. This object is passed to the <paramref name="callback" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred while attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010F8 RID: 4344 RVA: 0x000315A0 File Offset: 0x0002F7A0
|
||||
public IAsyncResult BeginAcceptSocket(AsyncCallback callback, object state)
|
||||
{
|
||||
if (this.server == null)
|
||||
{
|
||||
throw new ObjectDisposedException(base.GetType().ToString());
|
||||
}
|
||||
return this.server.BeginAccept(callback, state);
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous operation to accept an incoming connection attempt.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous creation of the <see cref="T:System.Net.Sockets.TcpClient" />.</returns>
|
||||
/// <param name="callback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete.</param>
|
||||
/// <param name="state">A user-defined object containing information about the accept operation. This object is passed to the <paramref name="callback" /> delegate when the operation is complete.</param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred while attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010F9 RID: 4345 RVA: 0x000315CC File Offset: 0x0002F7CC
|
||||
public IAsyncResult BeginAcceptTcpClient(AsyncCallback callback, object state)
|
||||
{
|
||||
if (this.server == null)
|
||||
{
|
||||
throw new ObjectDisposedException(base.GetType().ToString());
|
||||
}
|
||||
return this.server.BeginAccept(callback, state);
|
||||
}
|
||||
|
||||
/// <summary>Asynchronously accepts an incoming connection attempt and creates a new <see cref="T:System.Net.Sockets.Socket" /> to handle remote host communication.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> returned by a call to the <see cref="M:System.Net.Sockets.TcpListener.BeginAcceptSocket(System.AsyncCallback,System.Object)" /> method.</param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="asyncResult" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="asyncResult" /> parameter was not created by a call to the <see cref="M:System.Net.Sockets.TcpListener.BeginAcceptSocket(System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="M:System.Net.Sockets.TcpListener.EndAcceptSocket(System.IAsyncResult)" /> method was previously called. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred while attempting to access the <see cref="T:System.Net.Sockets.Socket" />. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010FA RID: 4346 RVA: 0x000315F8 File Offset: 0x0002F7F8
|
||||
public Socket EndAcceptSocket(IAsyncResult asyncResult)
|
||||
{
|
||||
return this.server.EndAccept(asyncResult);
|
||||
}
|
||||
|
||||
/// <summary>Asynchronously accepts an incoming connection attempt and creates a new <see cref="T:System.Net.Sockets.TcpClient" /> to handle remote host communication.</summary>
|
||||
/// <returns>A <see cref="T:System.Net.Sockets.TcpClient" />.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> returned by a call to the <see cref="M:System.Net.Sockets.TcpListener.BeginAcceptTcpClient(System.AsyncCallback,System.Object)" /> method.</param>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010FB RID: 4347 RVA: 0x00031608 File Offset: 0x0002F808
|
||||
public TcpClient EndAcceptTcpClient(IAsyncResult asyncResult)
|
||||
{
|
||||
Socket socket = this.server.EndAccept(asyncResult);
|
||||
TcpClient tcpClient = new TcpClient();
|
||||
tcpClient.SetTcpClient(socket);
|
||||
return tcpClient;
|
||||
}
|
||||
|
||||
/// <summary>Closes the listener.</summary>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">Use the <see cref="P:System.Net.Sockets.SocketException.ErrorCode" /> property to obtain the specific error code. When you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x060010FC RID: 4348 RVA: 0x00031630 File Offset: 0x0002F830
|
||||
public void Stop()
|
||||
{
|
||||
if (this.active)
|
||||
{
|
||||
this.server.Close();
|
||||
this.server = null;
|
||||
}
|
||||
this.Init(AddressFamily.InterNetwork, this.savedEP);
|
||||
}
|
||||
|
||||
// Token: 0x04000F3B RID: 3899
|
||||
private bool active;
|
||||
|
||||
// Token: 0x04000F3C RID: 3900
|
||||
private Socket server;
|
||||
|
||||
// Token: 0x04000F3D RID: 3901
|
||||
private EndPoint savedEP;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>The <see cref="T:System.Net.Sockets.TransmitFileOptions" /> enumeration defines values used in file transfer requests.</summary>
|
||||
// Token: 0x020001F9 RID: 505
|
||||
[Flags]
|
||||
public enum TransmitFileOptions
|
||||
{
|
||||
/// <summary>Use the default thread to process long file transfer requests.</summary>
|
||||
// Token: 0x04000F3F RID: 3903
|
||||
UseDefaultWorkerThread = 0,
|
||||
/// <summary>Start a transport-level disconnect after all the file data has been queued for transmission. When used with <see cref="F:System.Net.Sockets.TransmitFileOptions.ReuseSocket" />, these flags return the socket to a disconnected, reusable state after the file has been transmitted.</summary>
|
||||
// Token: 0x04000F40 RID: 3904
|
||||
Disconnect = 1,
|
||||
/// <summary>The socket handle may be reused when the request completes. This flag is valid only if <see cref="F:System.Net.Sockets.TransmitFileOptions.Disconnect" /> is also specified. When used with <see cref="F:System.Net.Sockets.TransmitFileOptions.Disconnect" />, these flags return the socket to a disconnected, reusable state after the file has been transmitted.</summary>
|
||||
// Token: 0x04000F41 RID: 3905
|
||||
ReuseSocket = 2,
|
||||
/// <summary>Complete the file transfer request immediately, without pending. If this flag is specified and the file transfer succeeds, the data has been accepted by the system but not necessarily acknowledged by the remote end. Do not use this flag with the <see cref="F:System.Net.Sockets.TransmitFileOptions.Disconnect" /> and <see cref="F:System.Net.Sockets.TransmitFileOptions.ReuseSocket" /> flags.</summary>
|
||||
// Token: 0x04000F42 RID: 3906
|
||||
WriteBehind = 4,
|
||||
/// <summary>Use system threads to process long file transfer requests.</summary>
|
||||
// Token: 0x04000F43 RID: 3907
|
||||
UseSystemThread = 16,
|
||||
/// <summary>Use kernel asynchronous procedure calls (APCs) instead of worker threads to process long file transfer requests. Long requests are defined as requests that require more than a single read from the file or a cache; the request therefore depends on the size of the file and the specified length of the send packet.</summary>
|
||||
// Token: 0x04000F44 RID: 3908
|
||||
UseKernelApc = 32
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,995 @@
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
/// <summary>Provides User Datagram Protocol (UDP) network services.</summary>
|
||||
// Token: 0x020001FA RID: 506
|
||||
public class UdpClient : IDisposable
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.UdpClient" /> class.</summary>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
// Token: 0x060010FD RID: 4349 RVA: 0x00031668 File Offset: 0x0002F868
|
||||
public UdpClient()
|
||||
: this(AddressFamily.InterNetwork)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.UdpClient" /> class.</summary>
|
||||
/// <param name="family">One of the <see cref="T:System.Net.Sockets.AddressFamily" /> values that specifies the addressing scheme of the socket. </param>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="family" /> is not <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /> or <see cref="F:System.Net.Sockets.AddressFamily.InterNetworkV6" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
// Token: 0x060010FE RID: 4350 RVA: 0x00031674 File Offset: 0x0002F874
|
||||
public UdpClient(AddressFamily family)
|
||||
{
|
||||
this.family = AddressFamily.InterNetwork;
|
||||
base..ctor();
|
||||
if (family != AddressFamily.InterNetwork && family != AddressFamily.InterNetworkV6)
|
||||
{
|
||||
throw new ArgumentException("Family must be InterNetwork or InterNetworkV6", "family");
|
||||
}
|
||||
this.family = family;
|
||||
this.InitSocket(null);
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.UdpClient" /> class and binds it to the local port number provided.</summary>
|
||||
/// <param name="port">The local port number from which you intend to communicate. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="port" /> parameter is greater than <see cref="F:System.Net.IPEndPoint.MaxPort" /> or less than <see cref="F:System.Net.IPEndPoint.MinPort" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
// Token: 0x060010FF RID: 4351 RVA: 0x000316BC File Offset: 0x0002F8BC
|
||||
public UdpClient(int port)
|
||||
{
|
||||
this.family = AddressFamily.InterNetwork;
|
||||
base..ctor();
|
||||
if (port < 0 || port > 65535)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("port");
|
||||
}
|
||||
this.family = AddressFamily.InterNetwork;
|
||||
IPEndPoint ipendPoint = new IPEndPoint(IPAddress.Any, port);
|
||||
this.InitSocket(ipendPoint);
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.UdpClient" /> class and binds it to the specified local endpoint.</summary>
|
||||
/// <param name="localEP">An <see cref="T:System.Net.IPEndPoint" /> that respresents the local endpoint to which you bind the UDP connection. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="localEP" /> is null. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
// Token: 0x06001100 RID: 4352 RVA: 0x00031710 File Offset: 0x0002F910
|
||||
public UdpClient(IPEndPoint localEP)
|
||||
{
|
||||
this.family = AddressFamily.InterNetwork;
|
||||
base..ctor();
|
||||
if (localEP == null)
|
||||
{
|
||||
throw new ArgumentNullException("localEP");
|
||||
}
|
||||
this.family = localEP.AddressFamily;
|
||||
this.InitSocket(localEP);
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.UdpClient" /> class and binds it to the local port number provided.</summary>
|
||||
/// <param name="port">The port on which to listen for incoming connection attempts. </param>
|
||||
/// <param name="family">One of the <see cref="T:System.Net.Sockets.AddressFamily" /> values that specifies the addressing scheme of the socket. </param>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="family" /> is not <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /> or <see cref="F:System.Net.Sockets.AddressFamily.InterNetworkV6" />. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="port" /> is greater than <see cref="F:System.Net.IPEndPoint.MaxPort" /> or less than <see cref="F:System.Net.IPEndPoint.MinPort" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
// Token: 0x06001101 RID: 4353 RVA: 0x00031744 File Offset: 0x0002F944
|
||||
public UdpClient(int port, AddressFamily family)
|
||||
{
|
||||
this.family = AddressFamily.InterNetwork;
|
||||
base..ctor();
|
||||
if (family != AddressFamily.InterNetwork && family != AddressFamily.InterNetworkV6)
|
||||
{
|
||||
throw new ArgumentException("Family must be InterNetwork or InterNetworkV6", "family");
|
||||
}
|
||||
if (port < 0 || port > 65535)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("port");
|
||||
}
|
||||
this.family = family;
|
||||
IPEndPoint ipendPoint;
|
||||
if (family == AddressFamily.InterNetwork)
|
||||
{
|
||||
ipendPoint = new IPEndPoint(IPAddress.Any, port);
|
||||
}
|
||||
else
|
||||
{
|
||||
ipendPoint = new IPEndPoint(IPAddress.IPv6Any, port);
|
||||
}
|
||||
this.InitSocket(ipendPoint);
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Sockets.UdpClient" /> class and establishes a default remote host.</summary>
|
||||
/// <param name="hostname">The name of the remote DNS host to which you intend to connect. </param>
|
||||
/// <param name="port">The remote port number to which you intend to connect. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="hostname" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="port" /> is not between <see cref="F:System.Net.IPEndPoint.MinPort" /> and <see cref="F:System.Net.IPEndPoint.MaxPort" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
// Token: 0x06001102 RID: 4354 RVA: 0x000317CC File Offset: 0x0002F9CC
|
||||
public UdpClient(string hostname, int port)
|
||||
{
|
||||
this.family = AddressFamily.InterNetwork;
|
||||
base..ctor();
|
||||
if (hostname == null)
|
||||
{
|
||||
throw new ArgumentNullException("hostname");
|
||||
}
|
||||
if (port < 0 || port > 65535)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("port");
|
||||
}
|
||||
this.InitSocket(null);
|
||||
this.Connect(hostname, port);
|
||||
}
|
||||
|
||||
/// <summary>Releases all resources used by the <see cref="T:System.Net.Sockets.UdpClient" />.</summary>
|
||||
// Token: 0x06001103 RID: 4355 RVA: 0x00031824 File Offset: 0x0002FA24
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
this.Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
// Token: 0x06001104 RID: 4356 RVA: 0x00031834 File Offset: 0x0002FA34
|
||||
private void InitSocket(EndPoint localEP)
|
||||
{
|
||||
if (this.socket != null)
|
||||
{
|
||||
this.socket.Close();
|
||||
this.socket = null;
|
||||
}
|
||||
this.socket = new Socket(this.family, SocketType.Dgram, ProtocolType.Udp);
|
||||
if (localEP != null)
|
||||
{
|
||||
this.socket.Bind(localEP);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Closes the UDP connection.</summary>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001105 RID: 4357 RVA: 0x00031884 File Offset: 0x0002FA84
|
||||
public void Close()
|
||||
{
|
||||
((IDisposable)this).Dispose();
|
||||
}
|
||||
|
||||
// Token: 0x06001106 RID: 4358 RVA: 0x0003188C File Offset: 0x0002FA8C
|
||||
private void DoConnect(IPEndPoint endPoint)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.socket.Connect(endPoint);
|
||||
}
|
||||
catch (SocketException ex)
|
||||
{
|
||||
if (ex.ErrorCode != 10013)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
|
||||
this.socket.Connect(endPoint);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Establishes a default remote host using the specified network endpoint.</summary>
|
||||
/// <param name="endPoint">An <see cref="T:System.Net.IPEndPoint" /> that specifies the network endpoint to which you intend to send data. </param>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="endPoint" /> is null. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.UdpClient" /> is closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001107 RID: 4359 RVA: 0x00031904 File Offset: 0x0002FB04
|
||||
public void Connect(IPEndPoint endPoint)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (endPoint == null)
|
||||
{
|
||||
throw new ArgumentNullException("endPoint");
|
||||
}
|
||||
this.DoConnect(endPoint);
|
||||
this.active = true;
|
||||
}
|
||||
|
||||
/// <summary>Establishes a default remote host using the specified IP address and port number.</summary>
|
||||
/// <param name="addr">The <see cref="T:System.Net.IPAddress" /> of the remote host to which you intend to send data. </param>
|
||||
/// <param name="port">The port number to which you intend send data. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">
|
||||
/// <see cref="T:System.Net.Sockets.UdpClient" /> is closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="addr" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="port" /> is not between <see cref="F:System.Net.IPEndPoint.MinPort" /> and <see cref="F:System.Net.IPEndPoint.MaxPort" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001108 RID: 4360 RVA: 0x0003192C File Offset: 0x0002FB2C
|
||||
public void Connect(IPAddress addr, int port)
|
||||
{
|
||||
if (addr == null)
|
||||
{
|
||||
throw new ArgumentNullException("addr");
|
||||
}
|
||||
if (port < 0 || port > 65535)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("port");
|
||||
}
|
||||
this.Connect(new IPEndPoint(addr, port));
|
||||
}
|
||||
|
||||
/// <summary>Establishes a default remote host using the specified host name and port number.</summary>
|
||||
/// <param name="hostname">The DNS name of the remote host to which you intend send data. </param>
|
||||
/// <param name="port">The port number on the remote host to which you intend to send data. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.UdpClient" /> is closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="port" /> is not between <see cref="F:System.Net.IPEndPoint.MinPort" /> and <see cref="F:System.Net.IPEndPoint.MaxPort" />. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001109 RID: 4361 RVA: 0x0003196C File Offset: 0x0002FB6C
|
||||
public void Connect(string hostname, int port)
|
||||
{
|
||||
if (port < 0 || port > 65535)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("port");
|
||||
}
|
||||
IPAddress[] hostAddresses = Dns.GetHostAddresses(hostname);
|
||||
for (int i = 0; i < hostAddresses.Length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.family = hostAddresses[i].AddressFamily;
|
||||
this.Connect(new IPEndPoint(hostAddresses[i], port));
|
||||
break;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (i == hostAddresses.Length - 1)
|
||||
{
|
||||
if (this.socket != null)
|
||||
{
|
||||
this.socket.Close();
|
||||
this.socket = null;
|
||||
}
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Leaves a multicast group.</summary>
|
||||
/// <param name="multicastAddr">The <see cref="T:System.Net.IPAddress" /> of the multicast group to leave. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The IP address is not compatible with the <see cref="T:System.Net.Sockets.AddressFamily" /> value that defines the addressing scheme of the socket. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="multicastAddr" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600110A RID: 4362 RVA: 0x00031A24 File Offset: 0x0002FC24
|
||||
public void DropMulticastGroup(IPAddress multicastAddr)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (multicastAddr == null)
|
||||
{
|
||||
throw new ArgumentNullException("multicastAddr");
|
||||
}
|
||||
if (this.family == AddressFamily.InterNetwork)
|
||||
{
|
||||
this.socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.DropMembership, new MulticastOption(multicastAddr));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.socket.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.DropMembership, new IPv6MulticastOption(multicastAddr));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Leaves a multicast group.</summary>
|
||||
/// <param name="multicastAddr">The <see cref="T:System.Net.IPAddress" /> of the multicast group to leave. </param>
|
||||
/// <param name="ifindex">The local address of the multicast group to leave.</param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The IP address is not compatible with the <see cref="T:System.Net.Sockets.AddressFamily" /> value that defines the addressing scheme of the socket. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="multicastAddr" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600110B RID: 4363 RVA: 0x00031A84 File Offset: 0x0002FC84
|
||||
public void DropMulticastGroup(IPAddress multicastAddr, int ifindex)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (multicastAddr == null)
|
||||
{
|
||||
throw new ArgumentNullException("multicastAddr");
|
||||
}
|
||||
if (this.family == AddressFamily.InterNetworkV6)
|
||||
{
|
||||
this.socket.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.DropMembership, new IPv6MulticastOption(multicastAddr, (long)ifindex));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Adds a <see cref="T:System.Net.Sockets.UdpClient" /> to a multicast group.</summary>
|
||||
/// <param name="multicastAddr">The multicast <see cref="T:System.Net.IPAddress" /> of the group you want to join. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The IP address is not compatible with the <see cref="T:System.Net.Sockets.AddressFamily" /> value that defines the addressing scheme of the socket. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600110C RID: 4364 RVA: 0x00031AC4 File Offset: 0x0002FCC4
|
||||
public void JoinMulticastGroup(IPAddress multicastAddr)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (multicastAddr == null)
|
||||
{
|
||||
throw new ArgumentNullException("multicastAddr");
|
||||
}
|
||||
if (this.family == AddressFamily.InterNetwork)
|
||||
{
|
||||
this.socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(multicastAddr));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.socket.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.AddMembership, new IPv6MulticastOption(multicastAddr));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Adds a <see cref="T:System.Net.Sockets.UdpClient" /> to a multicast group.</summary>
|
||||
/// <param name="ifindex">The local address. </param>
|
||||
/// <param name="multicastAddr">The multicast <see cref="T:System.Net.IPAddress" /> of the group you want to join. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600110D RID: 4365 RVA: 0x00031B24 File Offset: 0x0002FD24
|
||||
public void JoinMulticastGroup(int ifindex, IPAddress multicastAddr)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (multicastAddr == null)
|
||||
{
|
||||
throw new ArgumentNullException("multicastAddr");
|
||||
}
|
||||
if (this.family == AddressFamily.InterNetworkV6)
|
||||
{
|
||||
this.socket.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.AddMembership, new IPv6MulticastOption(multicastAddr, (long)ifindex));
|
||||
return;
|
||||
}
|
||||
throw new SocketException(10045);
|
||||
}
|
||||
|
||||
/// <summary>Adds a <see cref="T:System.Net.Sockets.UdpClient" /> to a multicast group with the specified Time to Live (TTL).</summary>
|
||||
/// <param name="multicastAddr">The <see cref="T:System.Net.IPAddress" /> of the multicast group to join. </param>
|
||||
/// <param name="timeToLive">The Time to Live (TTL), measured in router hops. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The TTL provided is not between 0 and 255 </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="multicastAddr" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The IP address is not compatible with the <see cref="T:System.Net.Sockets.AddressFamily" /> value that defines the addressing scheme of the socket. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600110E RID: 4366 RVA: 0x00031B7C File Offset: 0x0002FD7C
|
||||
public void JoinMulticastGroup(IPAddress multicastAddr, int timeToLive)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (multicastAddr == null)
|
||||
{
|
||||
throw new ArgumentNullException("multicastAddr");
|
||||
}
|
||||
if (timeToLive < 0 || timeToLive > 255)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("timeToLive");
|
||||
}
|
||||
this.JoinMulticastGroup(multicastAddr);
|
||||
if (this.family == AddressFamily.InterNetwork)
|
||||
{
|
||||
this.socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, timeToLive);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.socket.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.MulticastTimeToLive, timeToLive);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Adds a <see cref="T:System.Net.Sockets.UdpClient" /> to a multicast group.</summary>
|
||||
/// <param name="multicastAddr">The multicast <see cref="T:System.Net.IPAddress" /> of the group you want to join.</param>
|
||||
/// <param name="localAddress">The local <see cref="T:System.Net.IPAddress" />.</param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600110F RID: 4367 RVA: 0x00031BF4 File Offset: 0x0002FDF4
|
||||
public void JoinMulticastGroup(IPAddress multicastAddr, IPAddress localAddress)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (this.family == AddressFamily.InterNetwork)
|
||||
{
|
||||
this.socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(multicastAddr, localAddress));
|
||||
return;
|
||||
}
|
||||
throw new SocketException(10045);
|
||||
}
|
||||
|
||||
/// <summary>Returns a UDP datagram that was sent by a remote host.</summary>
|
||||
/// <returns>An array of type <see cref="T:System.Byte" /> that contains datagram data.</returns>
|
||||
/// <param name="remoteEP">An <see cref="T:System.Net.IPEndPoint" /> that represents the remote host from which the data was sent. </param>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Net.SocketPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001110 RID: 4368 RVA: 0x00031C30 File Offset: 0x0002FE30
|
||||
public byte[] Receive(ref IPEndPoint remoteEP)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
byte[] array = new byte[65536];
|
||||
EndPoint endPoint;
|
||||
if (this.family == AddressFamily.InterNetwork)
|
||||
{
|
||||
endPoint = new IPEndPoint(IPAddress.Any, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
endPoint = new IPEndPoint(IPAddress.IPv6Any, 0);
|
||||
}
|
||||
int num = this.socket.ReceiveFrom(array, ref endPoint);
|
||||
if (num < array.Length)
|
||||
{
|
||||
array = this.CutArray(array, num);
|
||||
}
|
||||
remoteEP = (IPEndPoint)endPoint;
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x06001111 RID: 4369 RVA: 0x00031CA4 File Offset: 0x0002FEA4
|
||||
private int DoSend(byte[] dgram, int bytes, IPEndPoint endPoint)
|
||||
{
|
||||
int num;
|
||||
try
|
||||
{
|
||||
if (endPoint == null)
|
||||
{
|
||||
num = this.socket.Send(dgram, 0, bytes, SocketFlags.None);
|
||||
}
|
||||
else
|
||||
{
|
||||
num = this.socket.SendTo(dgram, 0, bytes, SocketFlags.None, endPoint);
|
||||
}
|
||||
}
|
||||
catch (SocketException ex)
|
||||
{
|
||||
if (ex.ErrorCode != 10013)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
|
||||
if (endPoint == null)
|
||||
{
|
||||
num = this.socket.Send(dgram, 0, bytes, SocketFlags.None);
|
||||
}
|
||||
else
|
||||
{
|
||||
num = this.socket.SendTo(dgram, 0, bytes, SocketFlags.None, endPoint);
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
/// <summary>Sends a UDP datagram to a remote host.</summary>
|
||||
/// <returns>The number of bytes sent.</returns>
|
||||
/// <param name="dgram">An array of type <see cref="T:System.Byte" /> that specifies the UDP datagram that you intend to send represented as an array of bytes. </param>
|
||||
/// <param name="bytes">The number of bytes in the datagram. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="dgram" /> is null. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.UdpClient" /> has already established a default remote host. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.UdpClient" /> is closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001112 RID: 4370 RVA: 0x00031D60 File Offset: 0x0002FF60
|
||||
public int Send(byte[] dgram, int bytes)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (dgram == null)
|
||||
{
|
||||
throw new ArgumentNullException("dgram");
|
||||
}
|
||||
if (!this.active)
|
||||
{
|
||||
throw new InvalidOperationException("Operation not allowed on non-connected sockets.");
|
||||
}
|
||||
return this.DoSend(dgram, bytes, null);
|
||||
}
|
||||
|
||||
/// <summary>Sends a UDP datagram to the host at the specified remote endpoint.</summary>
|
||||
/// <returns>The number of bytes sent.</returns>
|
||||
/// <param name="dgram">An array of type <see cref="T:System.Byte" /> that specifies the UDP datagram that you intend to send, represented as an array of bytes. </param>
|
||||
/// <param name="bytes">The number of bytes in the datagram. </param>
|
||||
/// <param name="endPoint">An <see cref="T:System.Net.IPEndPoint" /> that represents the host and port to which to send the datagram. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="dgram" /> is null. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="T:System.Net.Sockets.UdpClient" /> has already established a default remote host. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">
|
||||
/// <see cref="T:System.Net.Sockets.UdpClient" /> is closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001113 RID: 4371 RVA: 0x00031DA4 File Offset: 0x0002FFA4
|
||||
public int Send(byte[] dgram, int bytes, IPEndPoint endPoint)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (dgram == null)
|
||||
{
|
||||
throw new ArgumentNullException("dgram is null");
|
||||
}
|
||||
if (!this.active)
|
||||
{
|
||||
return this.DoSend(dgram, bytes, endPoint);
|
||||
}
|
||||
if (endPoint != null)
|
||||
{
|
||||
throw new InvalidOperationException("Cannot send packets to an arbitrary host while connected.");
|
||||
}
|
||||
return this.DoSend(dgram, bytes, null);
|
||||
}
|
||||
|
||||
/// <summary>Sends a UDP datagram to a specified port on a specified remote host.</summary>
|
||||
/// <returns>The number of bytes sent.</returns>
|
||||
/// <param name="dgram">An array of type <see cref="T:System.Byte" /> that specifies the UDP datagram that you intend to send represented as an array of bytes. </param>
|
||||
/// <param name="bytes">The number of bytes in the datagram. </param>
|
||||
/// <param name="hostname">The name of the remote host to which you intend to send the datagram. </param>
|
||||
/// <param name="port">The remote port number with which you intend to communicate. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="dgram" /> is null. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Sockets.UdpClient" /> has already established a default remote host. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.UdpClient" /> is closed. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when accessing the socket. See the Remarks section for more information. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001114 RID: 4372 RVA: 0x00031DF8 File Offset: 0x0002FFF8
|
||||
public int Send(byte[] dgram, int bytes, string hostname, int port)
|
||||
{
|
||||
return this.Send(dgram, bytes, new IPEndPoint(Dns.GetHostAddresses(hostname)[0], port));
|
||||
}
|
||||
|
||||
// Token: 0x06001115 RID: 4373 RVA: 0x00031E14 File Offset: 0x00030014
|
||||
private byte[] CutArray(byte[] orig, int length)
|
||||
{
|
||||
byte[] array = new byte[length];
|
||||
Buffer.BlockCopy(orig, 0, array, 0, length);
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x06001116 RID: 4374 RVA: 0x00031E34 File Offset: 0x00030034
|
||||
private IAsyncResult DoBeginSend(byte[] datagram, int bytes, IPEndPoint endPoint, AsyncCallback requestCallback, object state)
|
||||
{
|
||||
IAsyncResult asyncResult;
|
||||
try
|
||||
{
|
||||
if (endPoint == null)
|
||||
{
|
||||
asyncResult = this.socket.BeginSend(datagram, 0, bytes, SocketFlags.None, requestCallback, state);
|
||||
}
|
||||
else
|
||||
{
|
||||
asyncResult = this.socket.BeginSendTo(datagram, 0, bytes, SocketFlags.None, endPoint, requestCallback, state);
|
||||
}
|
||||
}
|
||||
catch (SocketException ex)
|
||||
{
|
||||
if (ex.ErrorCode != 10013)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
|
||||
if (endPoint == null)
|
||||
{
|
||||
asyncResult = this.socket.BeginSend(datagram, 0, bytes, SocketFlags.None, requestCallback, state);
|
||||
}
|
||||
else
|
||||
{
|
||||
asyncResult = this.socket.BeginSendTo(datagram, 0, bytes, SocketFlags.None, endPoint, requestCallback, state);
|
||||
}
|
||||
}
|
||||
return asyncResult;
|
||||
}
|
||||
|
||||
/// <summary>Sends a datagram to a remote host asynchronously. The destination was specified previously by a call to <see cref="Overload:System.Net.Sockets.UdpClient.Connect" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that references the asynchronous send.</returns>
|
||||
/// <param name="datagram">A <see cref="T:System.Byte" /> array that contains the data to be sent.</param>
|
||||
/// <param name="bytes">The number of bytes to send.</param>
|
||||
/// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete.</param>
|
||||
/// <param name="state">A user-defined object that contains information about the send operation. This object is passed to the <paramref name="requestCallback" /> delegate when the operation is complete.</param>
|
||||
// Token: 0x06001117 RID: 4375 RVA: 0x00031F00 File Offset: 0x00030100
|
||||
public IAsyncResult BeginSend(byte[] datagram, int bytes, AsyncCallback requestCallback, object state)
|
||||
{
|
||||
return this.BeginSend(datagram, bytes, null, requestCallback, state);
|
||||
}
|
||||
|
||||
/// <summary>Sends a datagram to a destination asynchronously. The destination is specified by a <see cref="T:System.Net.EndPoint" />.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that references the asynchronous send.</returns>
|
||||
/// <param name="datagram">A <see cref="T:System.Byte" /> array that contains the data to be sent.</param>
|
||||
/// <param name="bytes">The number of bytes to send.</param>
|
||||
/// <param name="endPoint">The <see cref="T:System.Net.EndPoint" /> that represents the destination for the data.</param>
|
||||
/// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete. </param>
|
||||
/// <param name="state">A user-defined object that contains information about the send operation. This object is passed to the <paramref name="requestCallback" /> delegate when the operation is complete.</param>
|
||||
// Token: 0x06001118 RID: 4376 RVA: 0x00031F10 File Offset: 0x00030110
|
||||
public IAsyncResult BeginSend(byte[] datagram, int bytes, IPEndPoint endPoint, AsyncCallback requestCallback, object state)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (datagram == null)
|
||||
{
|
||||
throw new ArgumentNullException("datagram");
|
||||
}
|
||||
return this.DoBeginSend(datagram, bytes, endPoint, requestCallback, state);
|
||||
}
|
||||
|
||||
/// <summary>Sends a datagram to a destination asynchronously. The destination is specified by the host name and port number.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that references the asynchronous send.</returns>
|
||||
/// <param name="datagram">A <see cref="T:System.Byte" /> array that contains the data to be sent.</param>
|
||||
/// <param name="bytes">The number of bytes to send.</param>
|
||||
/// <param name="hostname">The destination host.</param>
|
||||
/// <param name="port">The destination port number.</param>
|
||||
/// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete. </param>
|
||||
/// <param name="state">A user-defined object that contains information about the send operation. This object is passed to the <paramref name="requestCallback" /> delegate when the operation is complete.</param>
|
||||
// Token: 0x06001119 RID: 4377 RVA: 0x00031F44 File Offset: 0x00030144
|
||||
public IAsyncResult BeginSend(byte[] datagram, int bytes, string hostname, int port, AsyncCallback requestCallback, object state)
|
||||
{
|
||||
return this.BeginSend(datagram, bytes, new IPEndPoint(Dns.GetHostAddresses(hostname)[0], port), requestCallback, state);
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous send.</summary>
|
||||
/// <returns>If successful, the number of bytes sent to the <see cref="T:System.Net.Sockets.UdpClient" />.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> object returned by a call to <see cref="Overload:System.Net.Sockets.UdpClient.BeginSend" />.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.Socket.BeginSend(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.Socket.EndSend(System.IAsyncResult)" /> was previously called for the asynchronous read. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the underlying socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x0600111A RID: 4378 RVA: 0x00031F64 File Offset: 0x00030164
|
||||
public int EndSend(IAsyncResult asyncResult)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (asyncResult == null)
|
||||
{
|
||||
throw new ArgumentNullException("asyncResult is a null reference");
|
||||
}
|
||||
return this.socket.EndSend(asyncResult);
|
||||
}
|
||||
|
||||
/// <summary>Receives a datagram from a remote host asynchronously.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that references the asynchronous receive.</returns>
|
||||
/// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete. </param>
|
||||
/// <param name="state">A user-defined object that contains information about the receive operation. This object is passed to the <paramref name="requestCallback" /> delegate when the operation is complete.</param>
|
||||
// Token: 0x0600111B RID: 4379 RVA: 0x00031F8C File Offset: 0x0003018C
|
||||
public IAsyncResult BeginReceive(AsyncCallback callback, object state)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
this.recvbuffer = new byte[8192];
|
||||
EndPoint endPoint;
|
||||
if (this.family == AddressFamily.InterNetwork)
|
||||
{
|
||||
endPoint = new IPEndPoint(IPAddress.Any, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
endPoint = new IPEndPoint(IPAddress.IPv6Any, 0);
|
||||
}
|
||||
return this.socket.BeginReceiveFrom(this.recvbuffer, 0, 8192, SocketFlags.None, ref endPoint, callback, state);
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous receive.</summary>
|
||||
/// <returns>If successful, the number of bytes received. If unsuccessful, this method returns 0.</returns>
|
||||
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> object returned by a call to <see cref="M:System.Net.Sockets.UdpClient.BeginReceive(System.AsyncCallback,System.Object)" />.</param>
|
||||
/// <param name="remoteEP">The specified remote endpoint.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="asyncResult" /> is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="asyncResult" /> was not returned by a call to the <see cref="M:System.Net.Sockets.UdpClient.BeginReceive(System.AsyncCallback,System.Object)" /> method. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// <see cref="M:System.Net.Sockets.UdpClient.EndReceive(System.IAsyncResult,System.Net.IPEndPoint@)" /> was previously called for the asynchronous read. </exception>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the underlying <see cref="T:System.Net.Sockets.Socket" />. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
// Token: 0x0600111C RID: 4380 RVA: 0x00031FF4 File Offset: 0x000301F4
|
||||
public byte[] EndReceive(IAsyncResult asyncResult, ref IPEndPoint remoteEP)
|
||||
{
|
||||
this.CheckDisposed();
|
||||
if (asyncResult == null)
|
||||
{
|
||||
throw new ArgumentNullException("asyncResult is a null reference");
|
||||
}
|
||||
EndPoint endPoint;
|
||||
if (this.family == AddressFamily.InterNetwork)
|
||||
{
|
||||
endPoint = new IPEndPoint(IPAddress.Any, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
endPoint = new IPEndPoint(IPAddress.IPv6Any, 0);
|
||||
}
|
||||
int num = this.socket.EndReceiveFrom(asyncResult, ref endPoint);
|
||||
remoteEP = (IPEndPoint)endPoint;
|
||||
byte[] array = new byte[num];
|
||||
Array.Copy(this.recvbuffer, array, num);
|
||||
return array;
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value indicating whether a default remote host has been established.</summary>
|
||||
/// <returns>true if a connection is active; otherwise, false.</returns>
|
||||
// Token: 0x170005A2 RID: 1442
|
||||
// (get) Token: 0x0600111D RID: 4381 RVA: 0x00032070 File Offset: 0x00030270
|
||||
// (set) Token: 0x0600111E RID: 4382 RVA: 0x00032078 File Offset: 0x00030278
|
||||
protected bool Active
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.active;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.active = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the underlying network <see cref="T:System.Net.Sockets.Socket" />.</summary>
|
||||
/// <returns>The underlying Network <see cref="T:System.Net.Sockets.Socket" />.</returns>
|
||||
// Token: 0x170005A3 RID: 1443
|
||||
// (get) Token: 0x0600111F RID: 4383 RVA: 0x00032084 File Offset: 0x00030284
|
||||
// (set) Token: 0x06001120 RID: 4384 RVA: 0x0003208C File Offset: 0x0003028C
|
||||
public Socket Client
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.socket;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.socket = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the amount of data received from the network that is available to read.</summary>
|
||||
/// <returns>The number of bytes of data received from the network.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred while attempting to access the socket. See the Remarks section for more information. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170005A4 RID: 1444
|
||||
// (get) Token: 0x06001121 RID: 4385 RVA: 0x00032098 File Offset: 0x00030298
|
||||
public int Available
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.socket.Available;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a <see cref="T:System.Boolean" /> value that specifies whether the <see cref="T:System.Net.Sockets.UdpClient" /> allows Internet Protocol (IP) datagrams to be fragmented.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.UdpClient" /> allows datagram fragmentation; otherwise, false. The default is true.</returns>
|
||||
/// <exception cref="T:System.NotSupportedException">This property can be set only for sockets that use the <see cref="F:System.Net.Sockets.AddressFamily.InterNetwork" /> flag or the <see cref="F:System.Net.Sockets.AddressFamily.InterNetworkV6" /> flag. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170005A5 RID: 1445
|
||||
// (get) Token: 0x06001122 RID: 4386 RVA: 0x000320A8 File Offset: 0x000302A8
|
||||
// (set) Token: 0x06001123 RID: 4387 RVA: 0x000320B8 File Offset: 0x000302B8
|
||||
public bool DontFragment
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.socket.DontFragment;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.socket.DontFragment = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a <see cref="T:System.Boolean" /> value that specifies whether the <see cref="T:System.Net.Sockets.UdpClient" /> may send or receive broadcast packets.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.UdpClient" /> allows broadcast packets; otherwise, false. The default is false.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170005A6 RID: 1446
|
||||
// (get) Token: 0x06001124 RID: 4388 RVA: 0x000320C8 File Offset: 0x000302C8
|
||||
// (set) Token: 0x06001125 RID: 4389 RVA: 0x000320D8 File Offset: 0x000302D8
|
||||
public bool EnableBroadcast
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.socket.EnableBroadcast;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.socket.EnableBroadcast = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a <see cref="T:System.Boolean" /> value that specifies whether the <see cref="T:System.Net.Sockets.UdpClient" /> allows only one client to use a port.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.UdpClient" /> allows only one client to use a specific port; otherwise, false. The default is true for Windows Server 2003 and Windows XP Service Pack 2 and later, and false for all other versions.</returns>
|
||||
/// <exception cref="T:System.Net.Sockets.SocketException">An error occurred when attempting to access the underlying socket.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The underlying <see cref="T:System.Net.Sockets.Socket" /> has been closed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170005A7 RID: 1447
|
||||
// (get) Token: 0x06001126 RID: 4390 RVA: 0x000320E8 File Offset: 0x000302E8
|
||||
// (set) Token: 0x06001127 RID: 4391 RVA: 0x000320F8 File Offset: 0x000302F8
|
||||
public bool ExclusiveAddressUse
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.socket.ExclusiveAddressUse;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.socket.ExclusiveAddressUse = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a <see cref="T:System.Boolean" /> value that specifies whether outgoing multicast packets are delivered to the sending application.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Net.Sockets.UdpClient" /> receives outgoing multicast packets; otherwise, false.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170005A8 RID: 1448
|
||||
// (get) Token: 0x06001128 RID: 4392 RVA: 0x00032108 File Offset: 0x00030308
|
||||
// (set) Token: 0x06001129 RID: 4393 RVA: 0x00032118 File Offset: 0x00030318
|
||||
public bool MulticastLoopback
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.socket.MulticastLoopback;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.socket.MulticastLoopback = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that specifies the Time to Live (TTL) value of Internet Protocol (IP) packets sent by the <see cref="T:System.Net.Sockets.UdpClient" />.</summary>
|
||||
/// <returns>The TTL value.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170005A9 RID: 1449
|
||||
// (get) Token: 0x0600112A RID: 4394 RVA: 0x00032128 File Offset: 0x00030328
|
||||
// (set) Token: 0x0600112B RID: 4395 RVA: 0x00032138 File Offset: 0x00030338
|
||||
public short Ttl
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.socket.Ttl;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.socket.Ttl = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Net.Sockets.UdpClient" /> and optionally releases the managed resources. </summary>
|
||||
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
|
||||
// Token: 0x0600112C RID: 4396 RVA: 0x00032148 File Offset: 0x00030348
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (this.disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.disposed = true;
|
||||
if (disposing)
|
||||
{
|
||||
if (this.socket != null)
|
||||
{
|
||||
this.socket.Close();
|
||||
}
|
||||
this.socket = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600112D RID: 4397 RVA: 0x0003218C File Offset: 0x0003038C
|
||||
~UdpClient()
|
||||
{
|
||||
this.Dispose(false);
|
||||
}
|
||||
|
||||
// Token: 0x0600112E RID: 4398 RVA: 0x000321C8 File Offset: 0x000303C8
|
||||
private void CheckDisposed()
|
||||
{
|
||||
if (this.disposed)
|
||||
{
|
||||
throw new ObjectDisposedException(base.GetType().FullName);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000F45 RID: 3909
|
||||
private bool disposed;
|
||||
|
||||
// Token: 0x04000F46 RID: 3910
|
||||
private bool active;
|
||||
|
||||
// Token: 0x04000F47 RID: 3911
|
||||
private Socket socket;
|
||||
|
||||
// Token: 0x04000F48 RID: 3912
|
||||
private AddressFamily family;
|
||||
|
||||
// Token: 0x04000F49 RID: 3913
|
||||
private byte[] recvbuffer;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user