Previous


1.1 Changes: Sockets

The JDK 1.1 release made three categories of enhancements to sockets:
  1. The Socket and ServerSocket classes are now extendable, non-final classes.
  2. New methods were added to support BSD-style options.
  3. New subclasses of SocketException were added to allow for finer granularity of network exception handling.
In addition, many bugs were fixed.

Deprecated Methods

Two constructors in the Socket class were deprecated. These constructors allowed programmers to create a DatagramSocket. Now programmers should explicitly construct a DatagramSocket if they want one.

Deprecated Methods Alternatives
Socket(InetAddress,int,boolean) One of DatagramSocket's three constructors
Socket(String,int,boolean) One of DatagramSocket's three constructors

New Methods

These constructors and methods were added to the indicated classes for the JDK 1.1. Note: The information in parenthesis indicates which category of enhancement the change was required for.
ServerSocket:
        ServerSocket(int, int, InetAddress) (bug fixes)

        implAccept (1)

        getSoTimeout (2)
        setSoTimeout (2)

Socket:
        Socket() (1)
        Socket(SocketImpl) (1)
        Socket(InetAddress, int, InetAddress, int) (bug fixes)
        Socket(String, int, InetAddress, int) (bug fixes)

        getLocalAddress (bug fixes)
        getSoLinger (2)
        getSoTimeout (2)
        getTcpNoDelay (2)
        setSoLinger (2)
        setSoTimeout (2)
        setTcpNoDelay (2)

SocketImpl:
        getOption (2)
        setOption (2)
For details, see Networking Enhancements


Previous