Java java.net MulticastSocket fields, constructors, methods, implement or subclass

Example usage for Java java.net MulticastSocket fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.net MulticastSocket.

The text is from its open source code.

Constructor

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.

Method

voidbind(SocketAddress addr)
Binds this DatagramSocket to a specific address and port.
voidclose()
Closes this datagram socket.
voiddisconnect()
Disconnects the socket.
InetAddressgetInterface()
Retrieve the address of the network interface used for multicast packets.
intgetLocalPort()
Returns the port number on the local host to which this socket is bound.
SocketAddressgetLocalSocketAddress()
Returns the address of the endpoint this socket is bound to.
booleangetLoopbackMode()
Get the setting for local loopback of multicast datagrams.
NetworkInterfacegetNetworkInterface()
Get the multicast network interface set.
intgetSoTimeout()
Retrieve setting for SO_TIMEOUT.
intgetTimeToLive()
Get the default time-to-live for multicast packets sent out on the socket.
voidjoinGroup(InetAddress mcastaddr)
Joins a multicast group.
voidjoinGroup(SocketAddress mcastaddr, NetworkInterface netIf)
Joins the specified multicast group at the specified interface.
voidleaveGroup(InetAddress mcastaddr)
Leave a multicast group.
voidleaveGroup(SocketAddress mcastaddr, NetworkInterface netIf)
Leave a multicast group on a specified local interface.
voidreceive(DatagramPacket p)
Receives a datagram packet from this socket.
voidsend(DatagramPacket p, byte ttl)
Sends a datagram packet to the destination, with a TTL (time- to-live) other than the default for the socket.
voidsend(DatagramPacket p)
Sends a datagram packet from this socket.
voidsetInterface(InetAddress inf)
Set the multicast network interface used by methods whose behavior would be affected by the value of the network interface.
voidsetLoopbackMode(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.
voidsetNetworkInterface(NetworkInterface netIf)
Specify the network interface for outgoing multicast datagrams sent on this socket.
voidsetReuseAddress(boolean on)
Enable/disable the SO_REUSEADDR socket option.
voidsetSoTimeout(int timeout)
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
voidsetTimeToLive(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.