Address test network issues am: 3380679886

am: 939401861e

Change-Id: I3ff1b57f1978053394db042265a5de20e389424a
This commit is contained in:
Rahul Frias
2016-12-13 09:30:21 +00:00
committed by android-build-merger

View File

@@ -13,6 +13,7 @@ namespace wvcdm {
namespace {
const int kMaxConnectAttempts = 3;
const int kReadBufferSize = 1024;
const int kConnectTimeoutMs = 15000;
const int kWriteTimeoutMs = 12000;
@@ -79,6 +80,7 @@ UrlRequest::UrlRequest(const std::string& url)
UrlRequest::~UrlRequest() {}
void UrlRequest::Reconnect() {
for(uint32_t i = 0; i < kMaxConnectAttempts && !is_connected_; ++i) {
socket_.CloseSocket();
if (socket_.Connect(kConnectTimeoutMs)) {
is_connected_ = true;
@@ -86,6 +88,7 @@ void UrlRequest::Reconnect() {
LOGE("failed to connect to %s, port=%d", socket_.domain_name().c_str(),
socket_.port());
}
}
}
bool UrlRequest::GetResponse(std::string* message) {