--- deliantra/server/socket/lowlevel.C 2007/06/24 04:09:29 1.48 +++ deliantra/server/socket/lowlevel.C 2007/07/12 19:36:58 1.50 @@ -1,22 +1,21 @@ /* - * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game. + * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. * * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team * Copyright (©) 1992,2007 Frank Tore Johansen * - * Crossfire TRT is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. + * Crossfire TRT is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . * * The authors can be reached via e-mail to */ @@ -34,6 +33,11 @@ # include #endif +#define HAVE_SIOCOUTQ 1 //TODO configure.ac support +#if HAVE_SIOCOUTQ +# include +#endif + // disconnect a socket after this many seconds without an ack #define SOCKET_TIMEOUT 8. @@ -47,6 +51,15 @@ if (destroyed ()) return; +# if HAVE_SIOCOUTQ + { + int value; + + if (!ioctl (fd, SIOCOUTQ, &value)) + outq = value; + } +# endif + #if HAVE_TCP_INFO // check about once per second, spread evenly over all clients // do this only when player is active