完善http超时管理

This commit is contained in:
xiongziliang
2018-02-28 17:30:12 +08:00
parent d9dea060d3
commit c2b11e3868
8 changed files with 15 additions and 16 deletions

View File

@@ -35,7 +35,7 @@ HttpClient::HttpClient(){
}
HttpClient::~HttpClient(){
}
void HttpClient::sendRequest(const string &strUrl){
void HttpClient::sendRequest(const string &strUrl,float fTimeOutSec){
auto protocol = FindField(strUrl.data(), NULL , "://");
uint16_t defaultPort;
bool isHttps;
@@ -84,7 +84,7 @@ void HttpClient::sendRequest(const string &strUrl){
if(!alive() || bChanged){
//InfoL << "reconnet:" << _lastHost;
startConnect(host, port);
startConnect(host, port,fTimeOutSec);
}else{
SockException ex;
onConnect(ex);