using System;
namespace System.Net.Sockets
{
/// Provides User Datagram Protocol (UDP) network services.
// Token: 0x020001FA RID: 506
public class UdpClient : IDisposable
{
/// Initializes a new instance of the class.
/// An error occurred when accessing the socket. See the Remarks section for more information.
// Token: 0x060010FD RID: 4349 RVA: 0x00031668 File Offset: 0x0002F868
public UdpClient()
: this(AddressFamily.InterNetwork)
{
}
/// Initializes a new instance of the class.
/// One of the values that specifies the addressing scheme of the socket.
///
/// is not or .
/// An error occurred when accessing the socket. See the Remarks section for more information.
// 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);
}
/// Initializes a new instance of the class and binds it to the local port number provided.
/// The local port number from which you intend to communicate.
/// The parameter is greater than or less than .
/// An error occurred when accessing the socket. See the Remarks section for more information.
// 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);
}
/// Initializes a new instance of the class and binds it to the specified local endpoint.
/// An that respresents the local endpoint to which you bind the UDP connection.
///
/// is null.
/// An error occurred when accessing the socket. See the Remarks section for more information.
// 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);
}
/// Initializes a new instance of the class and binds it to the local port number provided.
/// The port on which to listen for incoming connection attempts.
/// One of the values that specifies the addressing scheme of the socket.
///
/// is not or .
///
/// is greater than or less than .
/// An error occurred when accessing the socket. See the Remarks section for more information.
// 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);
}
/// Initializes a new instance of the class and establishes a default remote host.
/// The name of the remote DNS host to which you intend to connect.
/// The remote port number to which you intend to connect.
///
/// is null.
///
/// is not between and .
/// An error occurred when accessing the socket. See the Remarks section for more information.
// 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);
}
/// Releases all resources used by the .
// 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);
}
}
/// Closes the UDP connection.
/// An error occurred when accessing the socket. See the Remarks section for more information.
///
///
///
///
///
// 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);
}
}
/// Establishes a default remote host using the specified network endpoint.
/// An that specifies the network endpoint to which you intend to send data.
/// An error occurred when accessing the socket. See the Remarks section for more information.
///
/// is null.
/// The is closed.
///
///
///
///
///
///
///
// 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;
}
/// Establishes a default remote host using the specified IP address and port number.
/// The of the remote host to which you intend to send data.
/// The port number to which you intend send data.
///
/// is closed.
///
/// is null.
///
/// is not between and .
/// An error occurred when accessing the socket. See the Remarks section for more information.
///
///
///
///
///
///
///
// 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));
}
/// Establishes a default remote host using the specified host name and port number.
/// The DNS name of the remote host to which you intend send data.
/// The port number on the remote host to which you intend to send data.
/// The is closed.
///
/// is not between and .
/// An error occurred when accessing the socket. See the Remarks section for more information.
///
///
///
///
///
///
///
// 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;
}
}
}
}
/// Leaves a multicast group.
/// The of the multicast group to leave.
/// The underlying has been closed.
/// An error occurred when accessing the socket. See the Remarks section for more information.
/// The IP address is not compatible with the value that defines the addressing scheme of the socket.
///
/// is null.
///
///
///
///
///
// 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));
}
}
/// Leaves a multicast group.
/// The of the multicast group to leave.
/// The local address of the multicast group to leave.
/// The underlying has been closed.
/// An error occurred when accessing the socket. See the Remarks section for more information.
/// The IP address is not compatible with the value that defines the addressing scheme of the socket.
///
/// is null.
///
///
///
///
///
// 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));
}
}
/// Adds a to a multicast group.
/// The multicast of the group you want to join.
/// The underlying has been closed.
/// An error occurred when accessing the socket. See the Remarks section for more information.
/// The IP address is not compatible with the value that defines the addressing scheme of the socket.
///
///
///
///
///
// 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));
}
}
/// Adds a to a multicast group.
/// The local address.
/// The multicast of the group you want to join.
/// The underlying has been closed.
/// An error occurred when accessing the socket. See the Remarks section for more information.
///
///
///
///
///
// 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);
}
/// Adds a to a multicast group with the specified Time to Live (TTL).
/// The of the multicast group to join.
/// The Time to Live (TTL), measured in router hops.
/// The TTL provided is not between 0 and 255
/// The underlying has been closed.
/// An error occurred when accessing the socket. See the Remarks section for more information.
///
/// is null.
/// The IP address is not compatible with the value that defines the addressing scheme of the socket.
///
///
///
///
///
// 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);
}
}
/// Adds a to a multicast group.
/// The multicast of the group you want to join.
/// The local .
/// The underlying has been closed.
/// An error occurred when accessing the socket. See the Remarks section for more information.
///
///
///
///
///
// 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);
}
/// Returns a UDP datagram that was sent by a remote host.
/// An array of type that contains datagram data.
/// An that represents the remote host from which the data was sent.
/// The underlying has been closed.
/// An error occurred when accessing the socket. See the Remarks section for more information.
///
///
///
///
///
///
///
// 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;
}
/// Sends a UDP datagram to a remote host.
/// The number of bytes sent.
/// An array of type that specifies the UDP datagram that you intend to send represented as an array of bytes.
/// The number of bytes in the datagram.
///
/// is null.
/// The has already established a default remote host.
/// The is closed.
/// An error occurred when accessing the socket. See the Remarks section for more information.
///
///
///
///
///
///
// 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);
}
/// Sends a UDP datagram to the host at the specified remote endpoint.
/// The number of bytes sent.
/// An array of type that specifies the UDP datagram that you intend to send, represented as an array of bytes.
/// The number of bytes in the datagram.
/// An that represents the host and port to which to send the datagram.
///
/// is null.
///
/// has already established a default remote host.
///
/// is closed.
/// An error occurred when accessing the socket. See the Remarks section for more information.
///
///
///
///
///
///
// 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);
}
/// Sends a UDP datagram to a specified port on a specified remote host.
/// The number of bytes sent.
/// An array of type that specifies the UDP datagram that you intend to send represented as an array of bytes.
/// The number of bytes in the datagram.
/// The name of the remote host to which you intend to send the datagram.
/// The remote port number with which you intend to communicate.
///
/// is null.
/// The has already established a default remote host.
/// The is closed.
/// An error occurred when accessing the socket. See the Remarks section for more information.
///
///
///
///
///
///
// 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;
}
/// Sends a datagram to a remote host asynchronously. The destination was specified previously by a call to .
/// An object that references the asynchronous send.
/// A array that contains the data to be sent.
/// The number of bytes to send.
/// An delegate that references the method to invoke when the operation is complete.
/// A user-defined object that contains information about the send operation. This object is passed to the delegate when the operation is complete.
// 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);
}
/// Sends a datagram to a destination asynchronously. The destination is specified by a .
/// An object that references the asynchronous send.
/// A array that contains the data to be sent.
/// The number of bytes to send.
/// The that represents the destination for the data.
/// An delegate that references the method to invoke when the operation is complete.
/// A user-defined object that contains information about the send operation. This object is passed to the delegate when the operation is complete.
// 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);
}
/// Sends a datagram to a destination asynchronously. The destination is specified by the host name and port number.
/// An object that references the asynchronous send.
/// A array that contains the data to be sent.
/// The number of bytes to send.
/// The destination host.
/// The destination port number.
/// An delegate that references the method to invoke when the operation is complete.
/// A user-defined object that contains information about the send operation. This object is passed to the delegate when the operation is complete.
// 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);
}
/// Ends a pending asynchronous send.
/// If successful, the number of bytes sent to the .
/// An object returned by a call to .
///
/// is null.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous read.
/// An error occurred when attempting to access the underlying socket. See the Remarks section for more information.
/// The underlying has been closed.
// 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);
}
/// Receives a datagram from a remote host asynchronously.
/// An object that references the asynchronous receive.
/// An delegate that references the method to invoke when the operation is complete.
/// A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete.
// 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);
}
/// Ends a pending asynchronous receive.
/// If successful, the number of bytes received. If unsuccessful, this method returns 0.
/// An object returned by a call to .
/// The specified remote endpoint.
///
/// is null.
///
/// was not returned by a call to the method.
///
/// was previously called for the asynchronous read.
/// An error occurred when attempting to access the underlying . See the Remarks section for more information.
/// The underlying has been closed.
// 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;
}
/// Gets or sets a value indicating whether a default remote host has been established.
/// true if a connection is active; otherwise, false.
// 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;
}
}
/// Gets or sets the underlying network .
/// The underlying Network .
// 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;
}
}
/// Gets the amount of data received from the network that is available to read.
/// The number of bytes of data received from the network.
/// An error occurred while attempting to access the socket. See the Remarks section for more information.
/// The has been closed.
///
///
///
///
///
// Token: 0x170005A4 RID: 1444
// (get) Token: 0x06001121 RID: 4385 RVA: 0x00032098 File Offset: 0x00030298
public int Available
{
get
{
return this.socket.Available;
}
}
/// Gets or sets a value that specifies whether the allows Internet Protocol (IP) datagrams to be fragmented.
/// true if the allows datagram fragmentation; otherwise, false. The default is true.
/// This property can be set only for sockets that use the flag or the flag.
///
///
///
///
///
// 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;
}
}
/// Gets or sets a value that specifies whether the may send or receive broadcast packets.
/// true if the allows broadcast packets; otherwise, false. The default is false.
///
///
///
///
///
// 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;
}
}
/// Gets or sets a value that specifies whether the allows only one client to use a port.
/// true if the 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.
/// An error occurred when attempting to access the underlying socket.
/// The underlying has been closed.
///
///
///
///
///
// 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;
}
}
/// Gets or sets a value that specifies whether outgoing multicast packets are delivered to the sending application.
/// true if the receives outgoing multicast packets; otherwise, false.
///
///
///
///
///
// 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;
}
}
/// Gets or sets a value that specifies the Time to Live (TTL) value of Internet Protocol (IP) packets sent by the .
/// The TTL value.
///
///
///
///
///
// 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;
}
}
/// Releases the unmanaged resources used by the and optionally releases the managed resources.
/// true to release both managed and unmanaged resources; false to release only unmanaged resources.
// 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;
}
}