Package org.bitcoinj.net
Class SocketTimeoutTask
java.lang.Object
org.bitcoinj.net.SocketTimeoutTask
- All Implemented Interfaces:
TimeoutHandler
Component that implements the timeout capability of
TimeoutHandler.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidsetSocketTimeout(Duration timeout) Sets the receive timeout, automatically killing the connection if no messages are received for this longfinal voidsetTimeoutEnabled(boolean timeoutEnabled) Enables or disables the timeout entirely.
-
Constructor Details
-
SocketTimeoutTask
-
-
Method Details
-
setTimeoutEnabled
public final void setTimeoutEnabled(boolean timeoutEnabled) 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
Sets the receive timeout, automatically killing the connection if no messages are received for this long
A timeout of
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
-