drogonframework / drogonframework/drogon

How does drogon reuse existed connections?

Open
#1,998 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 13h
Merged PRs (30d)
14

Description

usually, i use HttpClient::newHttpClient as my client handler.

it it great, can reuse connections automatically.

but in my understanding, the tcp connections will be closed if long time no use.

so, how can i know if this request created connections or not (so that i can send heartbeat to keep alive)?

你好,drogon非常牛逼,本人原来使用curl,体验一言难尽。

我只使用客户端请求,并且非常在意http请求的延迟,所以我希望尽可能的保持连接被复用,并且请求函数不被阻塞

但是服务端有的时候会主动断开连接,这时候我希望我代码和日志中可以感知到连接断开,如何获取这一信息呢?

此外,我的场景,您是否有一些设置或者配置上的建议可以使之延迟更小,如果有,请不吝赐教,感谢

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.