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... } } }
Sets the read timeout for the undelying socket . A timeout of zero is interpreted as an infinite timeout .