MulticastSocket (Java SE 25 & JDK 25)
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Constructor Summary
Constructors
Constructs a multicast socket and binds it to any available port on the local host machine.
MulticastSocket(int port) Constructs a multicast socket and binds it to the specified port on the local host machine.
Creates a multicast socket, bound to the specified local socket address.
-
Method Summary
booleanGet the multicast network interface set for outgoing multicast datagrams sent from this socket.
intGet the default time-to-live for multicast packets sent out on the socket.
bytegetTTL()Deprecated, for removal: This API element is subject to removal in a future version.
voidvoidvoidvoidLeave a multicast group on a specified local interface.
voidDeprecated, for removal: This API element is subject to removal in a future version.
voidvoidsetLoopbackMode(boolean disable) voidSpecify the network interface for outgoing multicast datagrams sent on this socket.
voidsetTimeToLive(int ttl) Set the default time-to-live for multicast packets sent out on this
MulticastSocketin order to control the scope of the multicasts.voidsetTTL(byte ttl) Deprecated, for removal: This API element is subject to removal in a future version.
Methods declared in class DatagramSocket
bind, close, connect, connect, disconnect, getBroadcast, getChannel, getInetAddress, getLocalAddress, getLocalPort, getLocalSocketAddress, getOption, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoTimeout, getTrafficClass, isBound, isClosed, isConnected, receive, send, setBroadcast, setDatagramSocketImplFactory, setOption, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoTimeout, setTrafficClass, supportedOptions
-
Constructor Details
-
MulticastSocket
-
MulticastSocket
-
MulticastSocket
-
-
Method Details
-
setTTL
-
setTimeToLive
-
getTTL
-
getTimeToLive
-
joinGroup
-
leaveGroup
-
joinGroup
-
leaveGroup
-
setInterface
-
getInterface
-
setNetworkInterface
-
getNetworkInterface
-
setLoopbackMode
-
getLoopbackMode
-
send
-