MulticastSocket

public class MulticastSocket extends DatagramSocket

This class implements a multicast socket for sending and receiving IP multicast datagram packets.

See Also

Public Constructor Summary

MulticastSocket()
Constructs a multicast socket, bound to any available port on the local host.
MulticastSocket(int port)
Constructs a multicast socket, bound to the specified port on the local host.
MulticastSocket(SocketAddress localAddress)
Constructs a MulticastSocket bound to the address and port specified by localAddress, or an unbound MulticastSocket if localAddress == null.

Public Method Summary

InetAddress
getInterface()
Returns an address of the outgoing network interface used by this socket.
boolean
getLoopbackMode()
Returns true if multicast loopback is disabled.
NetworkInterface
getNetworkInterface()
Returns the outgoing network interface used by this socket.
byte
getTTL()
This method was deprecated. Use getTimeToLive() instead.
int
getTimeToLive()
Returns the time-to-live (TTL) for multicast packets sent on this socket.
void
joinGroup(SocketAddress groupAddress, NetworkInterface netInterface)
Adds this socket to the specified multicast group.
void
joinGroup(InetAddress groupAddr)
Adds this socket to the specified multicast group.
void
leaveGroup(SocketAddress groupAddress, NetworkInterface netInterface)
Removes this socket from the specified multicast group.
void
leaveGroup(InetAddress groupAddr)
Removes this socket from the specified multicast group.
void
send(DatagramPacket packet, byte ttl)
This method was deprecated. Use setTimeToLive(int) instead.
void
setInterface(InetAddress address)
Sets the outgoing network interface used by this socket.
void
setLoopbackMode(boolean disable)
Disables multicast loopback if disable == true.
void
setNetworkInterface(NetworkInterface networkInterface)
Sets the outgoing network interface used by this socket to the given networkInterface.
void
setTTL(byte ttl)
This method was deprecated. Use setTimeToLive(int) instead.
void
setTimeToLive(int ttl)
Sets the time-to-live (TTL) for multicast packets sent on this socket.

Inherited Method Summary