Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11440)

Unified Diff: chrome/test/chromedriver/net/adb_client_socket.cc

Issue 2349423003: Fallback to IPv6 if IPv4 adb port not available. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/net/adb_client_socket.cc
diff --git a/chrome/test/chromedriver/net/adb_client_socket.cc b/chrome/test/chromedriver/net/adb_client_socket.cc
index 9a5a672c6bc7e69fc06f35237c67cd837b01f100..5c9115bcb441fba89377a21121ed2b0b2eba7926 100644
--- a/chrome/test/chromedriver/net/adb_client_socket.cc
+++ b/chrome/test/chromedriver/net/adb_client_socket.cc
@@ -370,6 +370,15 @@ void AdbClientSocket::Connect(const net::CompletionCallback& callback) {
socket_.reset(new net::TCPClientSocket(address_list, NULL, NULL,
pmarks 2016/09/20 00:42:13 It looks like TCPClientSocket already supports con
lepton 2016/09/20 08:04:11 Done.
net::NetLog::Source()));
int result = socket_->Connect(callback);
+ if (result == net::ERR_ADDRESS_UNREACHABLE) {
+ VLOG(0) << "connect to IPv4 failed, trying IPv6";
+ address_list =
+ net::AddressList::CreateFromIPAddress(net::IPAddress::IPv6Localhost(),
+ port_);
+ socket_.reset(new net::TCPClientSocket(address_list, NULL, NULL,
+ net::NetLog::Source()));
+ result = socket_->Connect(callback);
+ }
if (result != net::ERR_IO_PENDING)
callback.Run(result);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698