最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Apache: http5 client: How to identify if the failure happened before or after connecting to the remote host? - Stack Overflow

programmeradmin5浏览0评论

When using CloseableHttpAsyncClient, the call back we provide FutureCallback has completed, failed, and cancelled callback methods. For any failures, the failed callback will be called with exception. This can be due to many things starting from connection pool manager to an exception in the remote server (and closing the connection or not responding within the time etc).

My question is, how can we deterministically figure out whether the failure happened before or after connecting to the remote host? My requirement is that, if my application connects to the remote host and then a failure happens, I will have to handle differently and if the failure happens before the connection successfully happens, I will have to handle it in another way.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论