Increase the number of connection attempts

In "adb forward" mode, it may take a while before the server socket is
listening, so increase the number of connection attempts.

See <https://github.com/Genymobile/scrcpy/issues/5#issuecomment-373718551>.
This commit is contained in:
Romain Vimont 2018-03-16 14:54:02 +01:00
parent 821ec9843c
commit c65cb36d3b

View file

@ -199,7 +199,7 @@ socket_t server_connect_to(struct server *server, Uint32 timeout_ms) {
if (!server->tunnel_forward) {
server->device_socket = net_accept(server->server_socket);
} else {
Uint32 attempts = 10;
Uint32 attempts = 50;
Uint32 delay = 100; // ms
server->device_socket = connect_to_server(server->local_port, attempts, delay);
}