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 <[email protected]>
Reviewed-by: Gumbel, Matthew K <[email protected]>
Reviewed-by: Jovanovic, Radivoje <[email protected]>
Reviewed-by: Boie, Andrew P <[email protected]>
diff --git a/services.c b/services.c
index 5b63a43..2d3423b 100644
--- a/services.c
+++ b/services.c
@@ -460,7 +460,7 @@
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;