java.net
Class DatagramSocket

java.lang.Object
  |
  +--java.net.DatagramSocket
Direct Known Subclasses:
MulticastSocket

public synchronized class DatagramSocket
extends Object


Constructor Summary
  DatagramSocket()
           
protected DatagramSocket(DatagramSocketImpl)
           
  DatagramSocket(int)
           
  DatagramSocket(int, InetAddress)
           
  DatagramSocket(SocketAddress)
           
 
Method Summary
 void bind(SocketAddress)
           
 void close()
           
 void connect(InetAddress, int)
           
 void connect(SocketAddress)
           
 void disconnect()
           
 boolean getBroadcast()
           
 java.nio.channels.DatagramChannel getChannel()
           
 InetAddress getInetAddress()
           
 InetAddress getLocalAddress()
           
 int getLocalPort()
           
 SocketAddress getLocalSocketAddress()
           
 int getPort()
           
 int getReceiveBufferSize()
           
 SocketAddress getRemoteSocketAddress()
           
 boolean getReuseAddress()
           
 int getSendBufferSize()
           
 int getSoTimeout()
           
 int getTrafficClass()
           
 boolean isBound()
           
 boolean isClosed()
           
 boolean isConnected()
           
 void receive(DatagramPacket)
           
 void send(DatagramPacket)
           
 void setBroadcast(boolean)
           
static void setDatagramSocketImplFactory(DatagramSocketImplFactory)
           
 void setReceiveBufferSize(int)
           
 void setReuseAddress(boolean)
           
 void setSendBufferSize(int)
           
 void setSoTimeout(int)
           
 void setTrafficClass(int)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

DatagramSocket

public DatagramSocket()
               throws SocketException

DatagramSocket

protected DatagramSocket(DatagramSocketImpl)

DatagramSocket

public DatagramSocket(SocketAddress)
               throws SocketException

DatagramSocket

public DatagramSocket(int)
               throws SocketException

DatagramSocket

public DatagramSocket(int,
                      InetAddress)
               throws SocketException
Method Detail

bind

public void bind(SocketAddress)
          throws SocketException
SocketException

connect

public void connect(InetAddress,
                    int)

connect

public void connect(SocketAddress)
             throws SocketException
SocketException

disconnect

public void disconnect()

isBound

public boolean isBound()

isConnected

public boolean isConnected()

getInetAddress

public InetAddress getInetAddress()

getPort

public int getPort()

getRemoteSocketAddress

public SocketAddress getRemoteSocketAddress()

getLocalSocketAddress

public SocketAddress getLocalSocketAddress()

send

public void send(DatagramPacket)
          throws IOException
IOException

receive

public void receive(DatagramPacket)
             throws IOException
IOException

getLocalAddress

public InetAddress getLocalAddress()

getLocalPort

public int getLocalPort()

setSoTimeout

public void setSoTimeout(int)
                  throws SocketException
SocketException

getSoTimeout

public int getSoTimeout()
                 throws SocketException
SocketException

setSendBufferSize

public void setSendBufferSize(int)
                       throws SocketException
SocketException

getSendBufferSize

public int getSendBufferSize()
                      throws SocketException
SocketException

setReceiveBufferSize

public void setReceiveBufferSize(int)
                          throws SocketException
SocketException

getReceiveBufferSize

public int getReceiveBufferSize()
                         throws SocketException
SocketException

setReuseAddress

public void setReuseAddress(boolean)
                     throws SocketException
SocketException

getReuseAddress

public boolean getReuseAddress()
                        throws SocketException
SocketException

setBroadcast

public void setBroadcast(boolean)
                  throws SocketException
SocketException

getBroadcast

public boolean getBroadcast()
                     throws SocketException
SocketException

setTrafficClass

public void setTrafficClass(int)
                     throws SocketException
SocketException

getTrafficClass

public int getTrafficClass()
                    throws SocketException
SocketException

close

public void close()

isClosed

public boolean isClosed()

getChannel

public java.nio.channels.DatagramChannel getChannel()

setDatagramSocketImplFactory

public static void setDatagramSocketImplFactory(DatagramSocketImplFactory)
                                         throws IOException
IOException