Example usage for Java java.net MulticastSocket fields, constructors, methods, implement or subclass
The text is from its open source code.
MulticastSocket(int port) Create a multicast socket and bind it to a specific port. | |
MulticastSocket(SocketAddress bindaddr) Create a MulticastSocket bound to the specified socket address. | |
MulticastSocket() Create a multicast socket. |
void | bind(SocketAddress addr) Binds this DatagramSocket to a specific address and port. |
void | close() Closes this datagram socket. |
void | disconnect() Disconnects the socket. |
InetAddress | getInterface() Retrieve the address of the network interface used for multicast packets. |
int | getLocalPort() Returns the port number on the local host to which this socket is bound. |
SocketAddress | getLocalSocketAddress() Returns the address of the endpoint this socket is bound to. |
boolean | getLoopbackMode() Get the setting for local loopback of multicast datagrams. |
NetworkInterface | getNetworkInterface() Get the multicast network interface set. |
int | getSoTimeout() Retrieve setting for SO_TIMEOUT. |
int | getTimeToLive() Get the default time-to-live for multicast packets sent out on the socket. |
void | joinGroup(InetAddress mcastaddr) Joins a multicast group. |
void | joinGroup(SocketAddress mcastaddr, NetworkInterface netIf) Joins the specified multicast group at the specified interface. |
void | leaveGroup(InetAddress mcastaddr) Leave a multicast group. |
void | leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf) Leave a multicast group on a specified local interface. |
void | receive(DatagramPacket p) Receives a datagram packet from this socket. |
void | send(DatagramPacket p, byte ttl) Sends a datagram packet to the destination, with a TTL (time- to-live) other than the default for the socket. |
void | send(DatagramPacket p) Sends a datagram packet from this socket. |
void | setInterface(InetAddress inf) Set the multicast network interface used by methods whose behavior would be affected by the value of the network interface. |
void | setLoopbackMode(boolean disable) Disable/Enable local loopback of multicast datagrams The option is used by the platform's networking code as a hint for setting whether multicast data will be looped back to the local socket. |
void | setNetworkInterface(NetworkInterface netIf) Specify the network interface for outgoing multicast datagrams sent on this socket. |
void | setReuseAddress(boolean on) Enable/disable the SO_REUSEADDR socket option. |
void | setSoTimeout(int timeout) Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. |
void | setTimeToLive(int ttl) Set the default time-to-live for multicast packets sent out on this MulticastSocket in order to control the scope of the multicasts. |