124 lines
4.3 KiB
C#
124 lines
4.3 KiB
C#
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;
|
|
}
|
|
}
|