Share via


MulticastSocket.JoinGroup Method

Definition

Overloads

JoinGroup(InetAddress)

Joins a multicast group.

JoinGroup(SocketAddress, NetworkInterface)

Joins the specified multicast group at the specified interface.

JoinGroup(InetAddress)

Joins a multicast group.

[Android.Runtime.Register("joinGroup", "(Ljava/net/InetAddress;)V", "GetJoinGroup_Ljava_net_InetAddress_Handler")]
public virtual void JoinGroup (Java.Net.InetAddress? mcastaddr);
[<Android.Runtime.Register("joinGroup", "(Ljava/net/InetAddress;)V", "GetJoinGroup_Ljava_net_InetAddress_Handler")>]
abstract member JoinGroup : Java.Net.InetAddress -> unit
override this.JoinGroup : Java.Net.InetAddress -> unit

Parameters

mcastaddr
InetAddress

is the multicast address to join

Attributes

Exceptions

if an error occurs.

Remarks

Joins a multicast group. Its behavior may be affected by setInterface or setNetworkInterface.

If there is a security manager, this method first calls its checkMulticast method with the mcastaddr argument as its argument.

Java documentation for java.net.MulticastSocket.joinGroup(java.net.InetAddress).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

JoinGroup(SocketAddress, NetworkInterface)

Joins the specified multicast group at the specified interface.

[Android.Runtime.Register("joinGroup", "(Ljava/net/SocketAddress;Ljava/net/NetworkInterface;)V", "GetJoinGroup_Ljava_net_SocketAddress_Ljava_net_NetworkInterface_Handler")]
public virtual void JoinGroup (Java.Net.SocketAddress? mcastaddr, Java.Net.NetworkInterface? netIf);
[<Android.Runtime.Register("joinGroup", "(Ljava/net/SocketAddress;Ljava/net/NetworkInterface;)V", "GetJoinGroup_Ljava_net_SocketAddress_Ljava_net_NetworkInterface_Handler")>]
abstract member JoinGroup : Java.Net.SocketAddress * Java.Net.NetworkInterface -> unit
override this.JoinGroup : Java.Net.SocketAddress * Java.Net.NetworkInterface -> unit

Parameters

mcastaddr
SocketAddress

is the multicast address to join

netIf
NetworkInterface

specifies the local interface to receive multicast datagram packets, or null to defer to the interface set by MulticastSocket#setInterface(InetAddress) or MulticastSocket#setNetworkInterface(NetworkInterface)

Attributes

Exceptions

if the specified address is not a multicast address.

if no multicast group is specified.

Remarks

Joins the specified multicast group at the specified interface.

If there is a security manager, this method first calls its checkMulticast method with the mcastaddr argument as its argument.

Added in 1.4.

Java documentation for java.net.MulticastSocket.joinGroup(java.net.SocketAddress, java.net.NetworkInterface).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to