src/java.base/share/classes/java/net/Socket.java
branchniosocketimpl-branch
changeset 57274 07b6be5d9150
parent 57268 adcdd45830a0
child 57293 67c102efba4b
equal deleted inserted replaced
57270:3519688a4e4d 57274:07b6be5d9150
  1219      */
  1219      */
  1220     public synchronized void setSoTimeout(int timeout) throws SocketException {
  1220     public synchronized void setSoTimeout(int timeout) throws SocketException {
  1221         if (isClosed())
  1221         if (isClosed())
  1222             throw new SocketException("Socket is closed");
  1222             throw new SocketException("Socket is closed");
  1223         if (timeout < 0)
  1223         if (timeout < 0)
  1224           throw new IllegalArgumentException("timeout can't be negative");
  1224           throw new IllegalArgumentException("timeout < 0");
  1225 
  1225 
  1226         getImpl().setOption(SocketOptions.SO_TIMEOUT, timeout);
  1226         getImpl().setOption(SocketOptions.SO_TIMEOUT, timeout);
  1227     }
  1227     }
  1228 
  1228 
  1229     /**
  1229     /**