Home » openjdk-7 » java » net » [javadoc | source]
java.net
abstract public class: DatagramSocketImpl [javadoc | source]
java.lang.Object
   java.net.DatagramSocketImpl

All Implemented Interfaces:
    SocketOptions

Direct Known Subclasses:
    DualStackPlainDatagramSocketImpl, ZDatagramSocketImpl, PlainDatagramSocketImpl, AbstractPlainDatagramSocketImpl, TwoStacksPlainDatagramSocketImpl

Abstract datagram and multicast socket implementation base class.
Field Summary
protected  int localPort    The local port number. 
protected  FileDescriptor fd    The file descriptor object. 
Method from java.net.DatagramSocketImpl Summary:
bind,   close,   connect,   create,   disconnect,   getFileDescriptor,   getLocalPort,   getTTL,   getTimeToLive,   join,   joinGroup,   leave,   leaveGroup,   peek,   peekData,   receive,   send,   setTTL,   setTimeToLive
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.net.DatagramSocketImpl Detail:
 abstract protected  void bind(int lport,
    InetAddress laddr) throws SocketException
    Binds a datagram socket to a local port and address.
 abstract protected  void close()
    Close the socket.
 protected  void connect(InetAddress address,
    int port) throws SocketException 
    Connects a datagram socket to a remote destination. This associates the remote address with the local socket so that datagrams may only be sent to this destination and received from this destination. This may be overridden to call a native system connect.

    If the remote destination to which the socket is connected does not exist, or is otherwise unreachable, and if an ICMP destination unreachable packet has been received for that address, then a subsequent call to send or receive may throw a PortUnreachableException. Note, there is no guarantee that the exception will be thrown.

 abstract protected  void create() throws SocketException
    Creates a datagram socket.
 protected  void disconnect() 
    Disconnects a datagram socket from its remote destination.
 protected FileDescriptor getFileDescriptor() 
    Gets the datagram socket file descriptor.
 protected int getLocalPort() 
    Gets the local port.
 abstract protected byte getTTL() throws IOExceptionDeprecated! use -  getTimeToLive instead.

    Retrieve the TTL (time-to-live) option.
 abstract protected int getTimeToLive() throws IOException
    Retrieve the TTL (time-to-live) option.
 abstract protected  void join(InetAddress inetaddr) throws IOException
    Join the multicast group.
 abstract protected  void joinGroup(SocketAddress mcastaddr,
    NetworkInterface netIf) throws IOException
    Join the multicast group.
 abstract protected  void leave(InetAddress inetaddr) throws IOException
    Leave the multicast group.
 abstract protected  void leaveGroup(SocketAddress mcastaddr,
    NetworkInterface netIf) throws IOException
    Leave the multicast group.
 abstract protected int peek(InetAddress i) throws IOException
    Peek at the packet to see who it is from. Updates the specified InetAddress to the address which the packet came from.
 abstract protected int peekData(DatagramPacket p) throws IOException
    Peek at the packet to see who it is from. The data is copied into the specified DatagramPacket. The data is returned, but not consumed, so that a subsequent peekData/receive operation will see the same data.
 abstract protected  void receive(DatagramPacket p) throws IOException
    Receive the datagram packet.
 abstract protected  void send(DatagramPacket p) throws IOException
    Sends a datagram packet. The packet contains the data and the destination address to send the packet to.
 abstract protected  void setTTL(byte ttl) throws IOExceptionDeprecated! use -  setTimeToLive instead.

    Set the TTL (time-to-live) option.
 abstract protected  void setTimeToLive(int ttl) throws IOException
    Set the TTL (time-to-live) option.