Address test network issues am: 3380679886
am: 939401861e
Change-Id: I3ff1b57f1978053394db042265a5de20e389424a
This commit is contained in:
@@ -13,6 +13,7 @@ namespace wvcdm {
|
||||
|
||||
namespace {
|
||||
|
||||
const int kMaxConnectAttempts = 3;
|
||||
const int kReadBufferSize = 1024;
|
||||
const int kConnectTimeoutMs = 15000;
|
||||
const int kWriteTimeoutMs = 12000;
|
||||
@@ -79,12 +80,14 @@ UrlRequest::UrlRequest(const std::string& url)
|
||||
UrlRequest::~UrlRequest() {}
|
||||
|
||||
void UrlRequest::Reconnect() {
|
||||
socket_.CloseSocket();
|
||||
if (socket_.Connect(kConnectTimeoutMs)) {
|
||||
is_connected_ = true;
|
||||
} else {
|
||||
LOGE("failed to connect to %s, port=%d", socket_.domain_name().c_str(),
|
||||
socket_.port());
|
||||
for(uint32_t i = 0; i < kMaxConnectAttempts && !is_connected_; ++i) {
|
||||
socket_.CloseSocket();
|
||||
if (socket_.Connect(kConnectTimeoutMs)) {
|
||||
is_connected_ = true;
|
||||
} else {
|
||||
LOGE("failed to connect to %s, port=%d", socket_.domain_name().c_str(),
|
||||
socket_.port());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user