summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorKen Lierman <ken.lierman@windriver.com>2013-06-20 09:27:13 -0700
committerElliott Hughes <enh@google.com>2014-05-19 16:16:42 -0700
commitaecc6a6657746afc9b95a960eedad10484bf14ac (patch)
tree892ed6eb7017161b3d6e81d53c4dc4edbd07d7e4 /adb
parentf03bd9537b77f996cddd562d88558151d3d6c7fd (diff)
downloadsystem_core-aecc6a6657746afc9b95a960eedad10484bf14ac.tar.gz
system_core-aecc6a6657746afc9b95a960eedad10484bf14ac.tar.bz2
system_core-aecc6a6657746afc9b95a960eedad10484bf14ac.zip
Bound the ADB connect time with a non-blocking connect
After a disconnect, the initial blocking connect takes a long time to return, while subsequent calls return quicks. Switch to a non-blocking connect to make the re-connect time more consistent and faster overall. Change-Id: I21d02b22a8eb9a457c2f1fa95eb17894d5612ccd Signed-off-by: Ken Lierman <ken.lierman@windriver.com> Reviewed-by: Gumbel, Matthew K <matthew.k.gumbel@intel.com> Reviewed-by: Jovanovic, Radivoje <radivoje.jovanovic@intel.com> Reviewed-by: Boie, Andrew P <andrew.p.boie@intel.com>
Diffstat (limited to 'adb')
-rw-r--r--adb/services.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/adb/services.c b/adb/services.c
index 5b63a43ba..2d3423b6c 100644
--- a/adb/services.c
+++ b/adb/services.c
@@ -460,7 +460,7 @@ static void connect_device(char* host, char* buffer, int buffer_size)
snprintf(serial, sizeof(serial), "%s:%d", hostbuf, port);
- fd = socket_network_client(hostbuf, port, SOCK_STREAM);
+ fd = socket_network_client_timeout(hostbuf, port, SOCK_STREAM, 10);
if (fd < 0) {
snprintf(buffer, buffer_size, "unable to connect to %s:%d", host, port);
return;