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

Comparing deliantra/server/socket/lowlevel.C (file contents):
Revision 1.49 by root, Sun Jul 1 05:00:20 2007 UTC vs.
Revision 1.50 by root, Thu Jul 12 19:36:58 2007 UTC

31# include <sys/socket.h> 31# include <sys/socket.h>
32# include <netinet/in.h> 32# include <netinet/in.h>
33# include <netinet/tcp.h> 33# include <netinet/tcp.h>
34#endif 34#endif
35 35
36#define HAVE_SIOCOUTQ 1 //TODO configure.ac support
37#if HAVE_SIOCOUTQ
38# include <linux/sockios.h>
39#endif
40
36// disconnect a socket after this many seconds without an ack 41// disconnect a socket after this many seconds without an ack
37#define SOCKET_TIMEOUT 8. 42#define SOCKET_TIMEOUT 8.
38 43
39// force a packet when idle for more than this many seconds, 44// force a packet when idle for more than this many seconds,
40// forcing an ack regularly. 45// forcing an ack regularly.
43void 48void
44client::flush () 49client::flush ()
45{ 50{
46 if (destroyed ()) 51 if (destroyed ())
47 return; 52 return;
53
54# if HAVE_SIOCOUTQ
55 {
56 int value;
57
58 if (!ioctl (fd, SIOCOUTQ, &value))
59 outq = value;
60 }
61# endif
48 62
49#if HAVE_TCP_INFO 63#if HAVE_TCP_INFO
50 // check about once per second, spread evenly over all clients 64 // check about once per second, spread evenly over all clients
51 // do this only when player is active 65 // do this only when player is active
52 if (!((pticks + fd) & 7) && pl && pl->active) 66 if (!((pticks + fd) & 7) && pl && pl->active)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines