public class MulticastOption
Object
MulticastOption
System
Networking
Contains Internet Protocol (IP) addresses used when joining or leaving an IP multicast group.
Collectively, the hosts listening to a specific IP multicast address (the group address) are called a multicast group. Each member of the group receives any IP messages sent to the group address.An instance of this class is passed into the System.Net.Sockets.Socket.SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Int32) method and returned by the System.Net.Sockets.Socket.GetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName) method when the optionName parameter is set to System.Net.Sockets.SocketOptionName.AddMembership or System.Net.Sockets.SocketOptionName.DropMembership.
System.Net.Sockets Namespace
MulticastOption Constructors
MulticastOption(System.Net.IPAddress, System.Net.IPAddress) Constructor
MulticastOption(System.Net.IPAddress) Constructor
MulticastOption Properties
MulticastOption.Group Property
MulticastOption.LocalAddress Property
public MulticastOption(IPAddress group, IPAddress mcint);
Constructs and initializes a new instance of the MulticastOption class with the specified IP multicast group and local addresses.
- group
- An instance of IPAddress containing the group IP address.
- mcint
- An instance of IPAddress containing the local IP address.
Exception Type Condition ArgumentNullException group or mcint is null
.
The System.Net.Sockets.MulticastOption.Group property is set to group and the System.Net.Sockets.MulticastOption.LocalAddress property is set to mcint.
System.Net.Sockets.MulticastOption Class, System.Net.Sockets Namespace
public MulticastOption(IPAddress group);
Constructs and initializes a new instance of the MulticastOption class with the specified IP multicast group address.
- group
- An instance of IPAddress containing the IP address of a multicast group.
Exception Type Condition ArgumentNullException group is null
.
This constructor initializes the System.Net.Sockets.MulticastOption.Group property of the new instance using group. The System.Net.Sockets.MulticastOption.LocalAddress property is initialized to System.Net.IPAddress.Any.Any
allows the protocol to decide which local IP address to use.
System.Net.Sockets.MulticastOption Class, System.Net.Sockets Namespace
public IPAddress Group { get; set; }
Gets or sets the IP address of a multicast group.
An instance of IPAddress containing the IP address of a multicast group.
Collectively, the hosts listening to a specific IP multicast address are called a multicast group. Each member of the group receives any IP messages sent to this address.[Note: Valid IP addresses for multicast groups are in the range 224.0.0.0 to 239.255.255.255 with some addresses reserved for special purposes.
]
System.Net.Sockets.MulticastOption Class, System.Net.Sockets Namespace
public IPAddress LocalAddress { get; set; }
Gets or sets the local IP address to receive data.
An instance of IPAddress containing the local IP address.
This property specifies the local IP address used to receive data sent to the multicast group.
System.Net.Sockets.MulticastOption Class, System.Net.Sockets Namespace