… | |
… | |
48 | |
48 | |
49 | #define BG_SCRUB_RATE 4 // how often to send a face in the background |
49 | #define BG_SCRUB_RATE 4 // how often to send a face in the background |
50 | |
50 | |
51 | #define MAX_QUEUE_DEPTH 50 |
51 | #define MAX_QUEUE_DEPTH 50 |
52 | #define MAX_QUEUE_BACKLOG 3. |
52 | #define MAX_QUEUE_BACKLOG 3. |
53 | |
|
|
54 | // disconnect a socket after this many seconds without an ack |
|
|
55 | #define SOCKET_TIMEOUT 16. |
|
|
56 | |
53 | |
57 | void |
54 | void |
58 | client::reset_state () |
55 | client::reset_state () |
59 | { |
56 | { |
60 | if (!pl) |
57 | if (!pl) |
… | |
… | |
169 | #endif |
166 | #endif |
170 | |
167 | |
171 | // fast-time-out a player by checking for missing acks |
168 | // fast-time-out a player by checking for missing acks |
172 | // do this only when player is active |
169 | // do this only when player is active |
173 | if (pl && pl->active |
170 | if (pl && pl->active |
174 | && tcpi.tcpi_last_ack_recv > int (SOCKET_TIMEOUT * 1000)) |
171 | && tcpi.tcpi_last_ack_recv > int (socket_timeout * 1000)) |
175 | { |
172 | { |
176 | send_msg (NDI_RED | NDI_REPLY, "connection-timeout", "safety disconnect due to tcp/ip timeout (no packets received)"); |
173 | send_msg (NDI_RED | NDI_REPLY, "connection-timeout", "safety disconnect due to tcp/ip timeout (no packets received)"); |
177 | write_outputbuffer (); |
174 | write_outputbuffer (); |
178 | |
175 | |
179 | LOG (llevDebug, "connection on fd %d closed due to ack timeout (%u/%u/%u)\n", fd, |
176 | LOG (llevDebug, "connection on fd %d closed due to ack timeout (%u/%u/%u)\n", fd, |