ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/loop.C
(Generate patch)

Comparing deliantra/server/socket/loop.C (file contents):
Revision 1.80 by root, Thu Jul 16 23:17:44 2009 UTC vs.
Revision 1.81 by root, Wed Sep 2 16:54:20 2009 UTC

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
57void 54void
58client::reset_state () 55client::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,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines