/** * Set the timeout for reads from this stream. * * Note: the behavior here can differ subtly depending on whether the * underlying socket has an associated Channel. In particular, if there is no * channel, then this call will affect the socket timeout for <em>all</em> * readers of this socket. If there is a channel, then this call will affect * the timeout only for <em>this</em> stream. As such, it is recommended to * only create one {@link SocketInputWrapper} instance per socket. * * @param timeoutMs * the new timeout, 0 for no timeout * @throws SocketException * if the timeout cannot be set */ public void setTimeout(long timeoutMs) throws SocketException { if (hasChannel) { ((SocketInputStream)in).setTimeout(timeoutMs); } else { socket.setSoTimeout((int)timeoutMs); } }
@Override public void setReadTimeout(int timeoutMs) throws IOException { in.setTimeout(timeoutMs); }
@Override public void setReadTimeout(int timeoutMs) throws IOException { in.setTimeout(timeoutMs); }
@Override public void setReadTimeout(int timeoutMs) throws IOException { in.setTimeout(timeoutMs); }
/** * Set the timeout for reads from this stream. * * Note: the behavior here can differ subtly depending on whether the * underlying socket has an associated Channel. In particular, if there is no * channel, then this call will affect the socket timeout for <em>all</em> * readers of this socket. If there is a channel, then this call will affect * the timeout only for <em>this</em> stream. As such, it is recommended to * only create one {@link SocketInputWrapper} instance per socket. * * @param timeoutMs * the new timeout, 0 for no timeout * @throws SocketException * if the timeout cannot be set */ public void setTimeout(long timeoutMs) throws SocketException { if (hasChannel) { ((SocketInputStream)in).setTimeout(timeoutMs); } else { socket.setSoTimeout((int)timeoutMs); } }
/** * Set the timeout for reads from this stream. * * Note: the behavior here can differ subtly depending on whether the * underlying socket has an associated Channel. In particular, if there is no * channel, then this call will affect the socket timeout for <em>all</em> * readers of this socket. If there is a channel, then this call will affect * the timeout only for <em>this</em> stream. As such, it is recommended to * only create one {@link SocketInputWrapper} instance per socket. * * @param timeoutMs * the new timeout, 0 for no timeout * @throws SocketException * if the timeout cannot be set */ public void setTimeout(long timeoutMs) throws SocketException { if (hasChannel) { ((SocketInputStream)in).setTimeout(timeoutMs); } else { socket.setSoTimeout((int)timeoutMs); } }
/** * Set the timeout for reads from this stream. * * Note: the behavior here can differ subtly depending on whether the * underlying socket has an associated Channel. In particular, if there is no * channel, then this call will affect the socket timeout for <em>all</em> * readers of this socket. If there is a channel, then this call will affect * the timeout only for <em>this</em> stream. As such, it is recommended to * only create one {@link SocketInputWrapper} instance per socket. * * @param timeoutMs * the new timeout, 0 for no timeout * @throws SocketException * if the timeout cannot be set */ public void setTimeout(long timeoutMs) throws SocketException { if (hasChannel) { ((SocketInputStream)in).setTimeout(timeoutMs); } else { socket.setSoTimeout((int)timeoutMs); } }
/** * Set the timeout for reads from this stream. * * Note: the behavior here can differ subtly depending on whether the * underlying socket has an associated Channel. In particular, if there is no * channel, then this call will affect the socket timeout for <em>all</em> * readers of this socket. If there is a channel, then this call will affect * the timeout only for <em>this</em> stream. As such, it is recommended to * only create one {@link SocketInputWrapper} instance per socket. * * @param timeoutMs * the new timeout, 0 for no timeout * @throws SocketException * if the timeout cannot be set */ public void setTimeout(long timeoutMs) throws SocketException { if (hasChannel) { ((SocketInputStream)in).setTimeout(timeoutMs); } else { socket.setSoTimeout((int)timeoutMs); } }
((SocketInputStream)in).setTimeout(TIMEOUT * 2); doIO(in, null, TIMEOUT * 2); ((SocketInputStream)in).setTimeout(0); TestingThread thread = new TestingThread(ctx) { @Override
((SocketInputStream)in).setTimeout(TIMEOUT * 2); doIO(in, null, TIMEOUT * 2); ((SocketInputStream)in).setTimeout(0); TestingThread thread = new TestingThread(ctx) { @Override