home
·
contact
·
privacy
projects
/
plomrogue
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0bc5f96
)
Client: Improve test_and_poll_server() ping test logic / timing.
author
Christian Heller
<c.heller@plomlompom.de>
Fri, 6 Feb 2015 01:11:11 +0000
(
02:11
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Fri, 6 Feb 2015 01:11:11 +0000
(
02:11
+0100)
src/client/io.c
patch
|
blob
|
history
diff --git
a/src/client/io.c
b/src/client/io.c
index 694ebfbfc43d2214842b5e14b1e722afb990b41a..ee4dcc2151a7a2ce87792a61a502ab03e6f47b11 100644
(file)
--- a/
src/client/io.c
+++ b/
src/client/io.c
@@
-204,6
+204,7
@@
static uint8_t read_worldstate()
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;
if (read_file_into_queue(world.file_server_out, &world.queue))
{
@@
-220,9
+221,10
@@
static void test_and_poll_server()
{
send("PING");
ping_sent = 1;
+ last_pong_time = now;
return;
}
- exit_err(
last_server_answer_time < now - 6
, "Server not answering.");
+ exit_err(
ping_sent && last_pong_time < now - 5
, "Server not answering.");
}