API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.net. MulticastSocket View Source
Author(s)
Pavani Diwanji
Since
JDK1.1
Version
Serial
Hierarchy
 Object
      DatagramSocket
          MulticastSocket
Implements
Subclasses
Description
public class MulticastSocket
  The multicast datagram socket class is useful for sending and receiving IP multicast packets.
See also:   
Constructors
public MulticastSocket () throws IOException
  Create a multicast socket.
public MulticastSocket (int port) throws IOException
  Create a multicast socket and bind it to a specific port.
public MulticastSocket (SocketAddress bindaddr) throws IOException
  Create a MulticastSocket bound to the specified socket address.
Methods
Hide/Show inherited methods
publicsynchronized void bind (SocketAddress addr) throws SocketException [Inherited From DatagramSocket]
  Binds this DatagramSocket to a specific address & port.
public void close () [Inherited From DatagramSocket]
  Closes this datagram socket.
public void connect (InetAddress address, int port) [Inherited From DatagramSocket]
  Connects the socket to a remote address for this socket.
public void connect (SocketAddress addr) throws SocketException [Inherited From DatagramSocket]
  Connects this socket to a remote socket address (IP address + port number).
pack-private void createImpl () throws SocketException [Inherited From DatagramSocket]
public void disconnect () [Inherited From DatagramSocket]
  Disconnects the socket.
publicsynchronized boolean getBroadcast () throws SocketException [Inherited From DatagramSocket]
  Tests if SO_BROADCAST is enabled.
public DatagramChannel getChannel () [Inherited From DatagramSocket]
  Returns the unique DatagramChannel object associated with this datagram socket, if any.
pack-private DatagramSocketImpl getImpl () throws SocketException [Inherited From DatagramSocket]
  Get the DatagramSocketImpl attached to this socket, creating it if necessary.
public InetAddress getInetAddress () [Inherited From DatagramSocket]
  Returns the address to which this socket is connected.
public InetAddress getInterface () throws SocketException
  Retrieve the address of the network interface used for multicast packets.
public InetAddress getLocalAddress () [Inherited From DatagramSocket]
  Gets the local address to which the socket is bound.
public int getLocalPort () [Inherited From DatagramSocket]
  Returns the port number on the local host to which this socket is bound.
public SocketAddress getLocalSocketAddress () [Inherited From DatagramSocket]
  Returns the address of the endpoint this socket is bound to, or null if it is not bound yet.
public boolean getLoopbackMode () throws SocketException
  Get the setting for local loopback of multicast datagrams.
public NetworkInterface getNetworkInterface () throws SocketException
  Get the multicast network interface set.
public int getPort () [Inherited From DatagramSocket]
  Returns the port for this socket.
publicsynchronized int getReceiveBufferSize () throws SocketException [Inherited From DatagramSocket]
  Get value of the SO_RCVBUF option for this DatagramSocket, that is the buffer size used by the platform for input on this DatagramSocket.
public SocketAddress getRemoteSocketAddress () [Inherited From DatagramSocket]
  Returns the address of the endpoint this socket is connected to, or null if it is unconnected.
publicsynchronized boolean getReuseAddress () throws SocketException [Inherited From DatagramSocket]
  Tests if SO_REUSEADDR is enabled.
publicsynchronized int getSendBufferSize () throws SocketException [Inherited From DatagramSocket]
  Get value of the SO_SNDBUF option for this DatagramSocket, that is the buffer size used by the platform for output on this DatagramSocket.
publicsynchronized int getSoTimeout () throws SocketException [Inherited From DatagramSocket]
  Retrieve setting for SO_TIMEOUT.
public int getTimeToLive () throws IOException
  Get the default time-to-live for multicast packets sent out on the socket.
publicsynchronized int getTrafficClass () throws SocketException [Inherited From DatagramSocket]
  Gets traffic class or type-of-service in the IP datagram header for packets sent from this DatagramSocket.
@Deprecated
public byte getTTL () throws IOException
  Get the default time-to-live for multicast packets sent out on the socket.
public boolean isBound () [Inherited From DatagramSocket]
  Returns the binding state of the socket.
public boolean isClosed () [Inherited From DatagramSocket]
  Returns whether the socket is closed or not.
public boolean isConnected () [Inherited From DatagramSocket]
  Returns the connection state of the socket.
public void joinGroup (InetAddress mcastaddr) throws IOException
  Joins a multicast group.
public void joinGroup (SocketAddress mcastaddr, NetworkInterface netIf) throws IOException
  Joins the specified multicast group at the specified interface.
public void leaveGroup (InetAddress mcastaddr) throws IOException
  Leave a multicast group.
public void leaveGroup (SocketAddress mcastaddr, NetworkInterface netIf) throws IOException
  Leave a multicast group on a specified local interface.
publicsynchronized void receive (DatagramPacket p) throws IOException [Inherited From DatagramSocket]
  Receives a datagram packet from this socket.
public void send (DatagramPacket p) throws IOException [Inherited From DatagramSocket]
  Sends a datagram packet from this socket.
@Deprecated
public void send (DatagramPacket p, byte ttl) throws IOException
  Sends a datagram packet to the destination, with a TTL (time- to-live) other than the default for the socket.
publicsynchronized void setBroadcast (boolean on) throws SocketException [Inherited From DatagramSocket]
  Enable/disable SO_BROADCAST.
publicstaticsynchronized void setDatagramSocketImplFactory (DatagramSocketImplFactory fac) throws IOException [Inherited From DatagramSocket]
  Sets the datagram socket implementation factory for the application.
public void setInterface (InetAddress inf) throws SocketException
  Set the multicast network interface used by methods whose behavior would be affected by the value of the network interface.
public void setLoopbackMode (boolean disable) throws SocketException
  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.
public void setNetworkInterface (NetworkInterface netIf) throws SocketException
  Specify the network interface for outgoing multicast datagrams sent on this socket.
publicsynchronized void setReceiveBufferSize (int size) throws SocketException [Inherited From DatagramSocket]
  Sets the SO_RCVBUF option to the specified value for this DatagramSocket.
publicsynchronized void setReuseAddress (boolean on) throws SocketException [Inherited From DatagramSocket]
  Enable/disable the SO_REUSEADDR socket option.
publicsynchronized void setSendBufferSize (int size) throws SocketException [Inherited From DatagramSocket]
  Sets the SO_SNDBUF option to the specified value for this DatagramSocket.
publicsynchronized void setSoTimeout (int timeout) throws SocketException [Inherited From DatagramSocket]
  Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
public void setTimeToLive (int ttl) throws IOException
  Set the default time-to-live for multicast packets sent out on this MulticastSocket in order to control the scope of the multicasts.
publicsynchronized void setTrafficClass (int tc) throws SocketException [Inherited From DatagramSocket]
  Sets traffic class or type-of-service octet in the IP datagram header for datagrams sent from this DatagramSocket.
@Deprecated
public void setTTL (byte ttl) throws IOException
  Set the default time-to-live for multicast packets sent out on this MulticastSocket in order to control the scope of the multicasts.
Fields
Hide/Show inherited fields
pack-private InetAddress connectedAddress [Inherited From DatagramSocket]
pack-private int connectedPort [Inherited From DatagramSocket]
pack-private int connectState [Inherited From DatagramSocket]
pack-privatestatic DatagramSocketImplFactory factory [Inherited From DatagramSocket]
The factory for all datagram sockets.
pack-private DatagramSocketImpl impl [Inherited From DatagramSocket]
pack-privatestatic Class implClass [Inherited From DatagramSocket]
pack-private boolean oldImpl [Inherited From DatagramSocket]
Are we using an older DatagramSocketImpl?
pack-privatefinalstatic int ST_CONNECTED = "1" [Inherited From DatagramSocket]
pack-privatefinalstatic int ST_CONNECTED_NO_IMPL = "2" [Inherited From DatagramSocket]
pack-privatefinalstatic int ST_NOT_CONNECTED = "0" [Inherited From DatagramSocket]
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar