From: Christian Heller Date: Wed, 9 Sep 2015 01:41:38 +0000 (+0200) Subject: Client: Slightly grow wait time in test_and_poll_server(). X-Git-Tag: tce~280 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/calendar?a=commitdiff_plain;h=bd7aea84a41b3ece88ffeff75b3e99023a3ca859;p=plomrogue Client: Slightly grow wait time in test_and_poll_server(). --- diff --git a/src/client/io.c b/src/client/io.c index 54b65c2..f47de03 100644 --- a/src/client/io.c +++ b/src/client/io.c @@ -207,25 +207,26 @@ static void test_and_poll_server() static time_t last_server_answer_time = 0; static time_t last_pong_time = 0; static uint8_t ping_sent = 0; + uint8_t wait = 15; if (read_file_into_queue(world.file_server_out, &world.queue)) { last_server_answer_time = time(0); return; } time_t now = time(0); - if (ping_sent && last_server_answer_time > now - 5) /* Re-set if last */ - { /* ping was answered */ - ping_sent = 0; /* with server */ - return; /* activity. */ + if (ping_sent && last_server_answer_time > now - wait)/* Re-set if last */ + { /* ping was answered*/ + ping_sent = 0; /* with server */ + return; /* activity. */ } - if (!ping_sent && last_server_answer_time < now - 5) + if (!ping_sent && last_server_answer_time < now - wait) { send("PING"); ping_sent = 1; last_pong_time = now; return; } - exit_err(ping_sent && last_pong_time < now - 5, "Server not answering."); + exit_err(ping_sent && last_pong_time < now - wait, "Server not answering."); }