MulticastOption Class

 

Contains IPAddress values used to join and drop multicast groups.

Namespace:   System.Net.Sockets
Assembly:  System (in System.dll)

System.Object
  System.Net.Sockets.MulticastOption

type MulticastOption = class end

NameDescription
System_CAPS_pubmethodMulticastOption(IPAddress)

Initializes a new version of the MulticastOption class for the specified IP multicast group.

System_CAPS_pubmethodMulticastOption(IPAddress, Int32)

Initializes a new instance of the MulticastOption class with the specified IP multicast group address and interface index.

System_CAPS_pubmethodMulticastOption(IPAddress, IPAddress)

Initializes a new instance of the MulticastOption class with the specified IP multicast group address and local IP address associated with a network interface.

NameDescription
System_CAPS_pubpropertyGroup

Gets or sets the IP address of a multicast group.

System_CAPS_pubpropertyInterfaceIndex

Gets or sets the index of the interface that is used to send and receive multicast packets.

System_CAPS_pubpropertyLocalAddress

Gets or sets the local address associated with a multicast group.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

Use a MulticastOption to store the IPAddress of a multicast group you want to join or drop. Use the Socket.SetSocketOption method with the following parameters to join a multicast group.

Parameter

Value

socketOptionLevel

SocketOptionLevel.Udp

socketOptionName

AddMembership

object

MulticastOption

Use DropMembership to drop a multicast group.

The following examples join the default IP interface to an IP multicast group. They assume the IP multicast group address in the range 224.0.0.0 to 239.255.255.255.

No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: