mscorlib(4.0.0.0) API with additions
MulticastOption.cs
1 namespace System.Net.Sockets
2 {
4  public class MulticastOption
5  {
6  private IPAddress group;
7 
8  private IPAddress localAddress;
9 
10  private int ifIndex;
11 
14  public IPAddress Group
15  {
16  get
17  {
18  return group;
19  }
20  set
21  {
22  group = value;
23  }
24  }
25 
28  public IPAddress LocalAddress
29  {
30  get
31  {
32  return localAddress;
33  }
34  set
35  {
36  ifIndex = 0;
37  localAddress = value;
38  }
39  }
40 
43  public int InterfaceIndex
44  {
45  get
46  {
47  return ifIndex;
48  }
49  set
50  {
51  if (value < 0 || value > 16777215)
52  {
53  throw new ArgumentOutOfRangeException("value");
54  }
55  localAddress = null;
56  ifIndex = value;
57  }
58  }
59 
66  public MulticastOption(IPAddress group, IPAddress mcint)
67  {
68  if (group == null)
69  {
70  throw new ArgumentNullException("group");
71  }
72  if (mcint == null)
73  {
74  throw new ArgumentNullException("mcint");
75  }
76  Group = group;
77  LocalAddress = mcint;
78  }
79 
83  public MulticastOption(IPAddress group, int interfaceIndex)
84  {
85  if (group == null)
86  {
87  throw new ArgumentNullException("group");
88  }
89  if (interfaceIndex < 0 || interfaceIndex > 16777215)
90  {
91  throw new ArgumentOutOfRangeException("interfaceIndex");
92  }
93  Group = group;
94  ifIndex = interfaceIndex;
95  }
96 
102  {
103  if (group == null)
104  {
105  throw new ArgumentNullException("group");
106  }
107  Group = group;
109  }
110  }
111 }
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
MulticastOption(IPAddress group, IPAddress mcint)
Initializes a new instance of the T:System.Net.Sockets.MulticastOption class with the specified IP mu...
static readonly IPAddress Any
Provides an IP address that indicates that the server must listen for client activity on all network ...
Definition: IPAddress.cs:14
The exception that is thrown when the value of an argument is outside the allowable range of values a...
IPAddress LocalAddress
Gets or sets the local address associated with a multicast group.
Provides an Internet Protocol (IP) address.
Definition: IPAddress.cs:10
MulticastOption(IPAddress group)
Initializes a new version of the T:System.Net.Sockets.MulticastOption class for the specified IP mult...
Contains T:System.Net.IPAddress values used to join and drop multicast groups.
MulticastOption(IPAddress group, int interfaceIndex)
Initializes a new instance of the T:System.Net.Sockets.MulticastOption class with the specified IP mu...
IPAddress Group
Gets or sets the IP address of a multicast group.
int InterfaceIndex
Gets or sets the index of the interface that is used to send and receive multicast packets.