This abstract class defines the methods necessary to implement communication through datagram and multicast sockets. System programmers may create subclasses of this class when they need to implement datagram or multicast sockets in a nonstandard network environment, such as behind a firewall or on a network that uses a nonstandard transport protocol. Normal applications never need to use or subclass this class. Figure 12-3. java.net.DatagramSocketImplpublic abstract class DatagramSocketImpl implements SocketOptions { // Public Constructors public DatagramSocketImpl ( ); // Protected Instance Methods protected abstract void bind (int lport , InetAddress laddr ) throws SocketException; protected abstract void close ( ); 1.4 protected void connect (InetAddress address , int port ) throws SocketException; empty protected abstract void create ( ) throws SocketException; 1.4 protected void disconnect ( ); empty protected java.io.FileDescriptor getFileDescriptor ( ); protected int getLocalPort ( ); 1.2 protected abstract int getTimeToLive ( ) throws java.io.IOException; protected abstract void join (InetAddress inetaddr ) throws java.io.IOException; 1.4 protected abstract void joinGroup (SocketAddress mcastaddr , NetworkInterface netIf ) throws java.io.IOException; protected abstract void leave (InetAddress inetaddr ) throws java.io.IOException; 1.4 protected abstract void leaveGroup (SocketAddress mcastaddr , NetworkInterface netIf ) throws java.io.IOException; protected abstract int peek (InetAddress i ) throws java.io.IOException; 1.4 protected abstract int peekData (DatagramPacket p ) throws java.io.IOException; protected abstract void receive (DatagramPacket p ) throws java.io.IOException; protected abstract void send (DatagramPacket p ) throws java.io.IOException; 1.2 protected abstract void setTimeToLive (int ttl ) throws java.io.IOException; // Protected Instance Fields protected java.io.FileDescriptor fd ; protected int localPort ; // Deprecated Protected Methods # protected abstract byte getTTL ( ) throws java.io.IOException; # protected abstract void setTTL (byte ttl ) throws java.io.IOException; } Passed ToDatagramSocket.DatagramSocket( ) Returned ByDatagramSocketImplFactory.createDatagramSocketImpl( ) |