public void setTimeout(int pTimeout) {
        if (pTimeout < 0) {  // Must be positive
            throw new IllegalArgumentException("Timeout must be positive.");
        }
        timeout = pTimeout;
        if (socket != null) {
            try {
                socket.setSoTimeout(pTimeout);
            }
            catch (SocketException se) {
                // Not much to do about that...
            }
        }
    }
public void setTimeout ( int pTimeout ) { if ( pTimeout < 0 ) { throw new IllegalArgumentException ( "Timeout must be positive." ) ; } timeout = pTimeout ; if ( socket != null ) { try { socket . setSoTimeout ( pTimeout ) ; } catch ( SocketException se ) { } } }
Sets the read timeout for the undelying socket.
A timeout of zero is interpreted as an
infinite timeout.

@param pTimeout the maximum time the socket will block for read
operations, in milliseconds.