private static void onTimeOut( final ProtonLink<?> link, final ClientConfigProperties clientConfig, final Future<?> result) { if (link.isOpen() && !HonoProtonHelper.isLinkEstablished(link)) { LOG.debug("link establishment timed out after {}ms", clientConfig.getLinkEstablishmentTimeout()); link.close(); link.free(); result.tryFail(new ServerErrorException(HttpsURLConnection.HTTP_UNAVAILABLE)); } }
private static void onRemoteDetach( final ProtonLink<?> link, final String remoteContainer, final boolean closed, final Handler<String> closeHook) { final ErrorCondition error = link.getRemoteCondition(); final String type = link instanceof ProtonSender ? "sender" : "receiver"; final String address = link instanceof ProtonSender ? link.getTarget().getAddress() : link.getSource().getAddress(); if (error == null) { LOG.debug("{} [{}] detached (with closed={}) by peer [{}]", type, address, closed, remoteContainer); } else { LOG.debug("{} [{}] detached (with closed={}) by peer [{}]: {} - {}", type, address, closed, remoteContainer, error.getCondition(), error.getDescription()); } link.close(); if (HonoProtonHelper.isLinkEstablished(link) && closeHook != null) { closeHook.handle(address); } } }
result.tryFail(StatusCodeMapper.from(error)); } else if (HonoProtonHelper.isLinkEstablished(receiver)) { LOG.debug("receiver open [source: {}]", sourceAddress); result.tryComplete(recvOpen.result());
} else if (HonoProtonHelper.isLinkEstablished(sender)) {