Code example for Socket

Methods: setSoLinger, setSoTimeout, setTcpNoDelay

    protected void prepareSocket( 
            final Socket sock,
            final HttpContext context,
            final HttpParams params) throws IOException {
        int linger = HttpConnectionParams.getLinger(params);
        if (linger >= 0) {
            sock.setSoLinger(linger > 0, linger);
     * Resolves the given host name to an array of corresponding IP addresses, based on the 
     * configured name service on the system. 
     * @param host host name to resolve 
     * @return array of IP addresses 
     * @exception  UnknownHostException  if no IP address for the host could be determined.