Package org.bitcoinj.net
Class AbstractTimeoutHandler
java.lang.Object
org.bitcoinj.net.AbstractTimeoutHandler
- All Implemented Interfaces:
TimeoutHandler
Deprecated.
A base class which provides basic support for socket timeouts. It is used instead of integrating timeouts into the
NIO select thread both for simplicity and to keep code shared between NIO and blocking sockets as much as possible.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated.Resets the current progress towards timeout to 0.final voidsetSocketTimeout(Duration timeout) Deprecated.Sets the receive timeout, automatically killing the connection if no messages are received for this longfinal voidsetTimeoutEnabled(boolean timeoutEnabled) Deprecated.Enables or disables the timeout entirely.protected abstract voidDeprecated.
-
Constructor Details
-
AbstractTimeoutHandler
public AbstractTimeoutHandler()Deprecated.
-
-
Method Details
-
setTimeoutEnabled
public final void setTimeoutEnabled(boolean timeoutEnabled) Deprecated.Enables or disables the timeout entirely. This may be useful if you want to store the timeout value but wish to temporarily disable/enable timeouts.
The default is for timeoutEnabled to be true but timeout to be set to
Duration.ZERO(ie disabled).This call will reset the current progress towards the timeout.
- Specified by:
setTimeoutEnabledin interfaceTimeoutHandler
-
setSocketTimeout
Deprecated.Sets the receive timeout, automatically killing the connection if no messages are received for this long
A timeout of 0
Duration.ZEROis interpreted as no timeout.The default is for timeoutEnabled to be true but timeout to be set to
Duration.ZERO(ie disabled).This call will reset the current progress towards the timeout.
- Specified by:
setSocketTimeoutin interfaceTimeoutHandler
-
resetTimeout
protected void resetTimeout()Deprecated.Resets the current progress towards timeout to 0. -
timeoutOccurred
protected abstract void timeoutOccurred()Deprecated.
-
TimeoutHandlerusingSocketTimeoutTaskinstead