use of tech.pegasys.teku.networking.eth2.rpc.core.RpcTimeouts.RpcTimeoutException in project teku by ConsenSys.
the class Eth2OutgoingRequestHandler method ensureReadCompleteArrivesInTime.
private void ensureReadCompleteArrivesInTime(final RpcStream stream) {
final Duration timeout = RpcTimeouts.RESP_TIMEOUT;
timeoutRunner.getDelayedFuture(timeout).thenAccept((__) -> {
if (!(state.get() == READ_COMPLETE || state.get() == CLOSED)) {
abortRequest(stream, new RpcTimeoutException("Timed out waiting for read channel close", timeout));
}
}).reportExceptions();
}
use of tech.pegasys.teku.networking.eth2.rpc.core.RpcTimeouts.RpcTimeoutException in project teku by ConsenSys.
the class Eth2OutgoingRequestHandler method ensureNextResponseArrivesInTime.
private void ensureNextResponseArrivesInTime(final RpcStream stream, final int previousResponseCount, final AtomicInteger currentResponseCount) {
final Duration timeout = RpcTimeouts.RESP_TIMEOUT;
timeoutRunner.getDelayedFuture(timeout).thenAccept((__) -> {
if (previousResponseCount == currentResponseCount.get()) {
abortRequest(stream, new RpcTimeoutException("Timed out waiting for response chunk " + previousResponseCount, timeout));
}
}).reportExceptions();
}
Aggregations