From c565936b3ac5b6e1ab0d5ca30963619c7b725bb6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 12 Apr 2013 19:52:03 +0300 Subject: fix tcp tuning options usage. --- src/localconsts.h | 1 + src/net/sdltcpnet.cpp | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/localconsts.h b/src/localconsts.h index ba803ca86..d6c535640 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -39,6 +39,7 @@ #endif #undef Z_NULL #define Z_NULL nullptr +#define M_TCPOK #define A_DELETE(func) func = delete #define A_DELETE_COPY(name) name(const name &) = delete; \ name &operator=(const name&) = delete; diff --git a/src/net/sdltcpnet.cpp b/src/net/sdltcpnet.cpp index 6ad350002..b38bc8a67 100644 --- a/src/net/sdltcpnet.cpp +++ b/src/net/sdltcpnet.cpp @@ -21,9 +21,24 @@ #include "net/sdltcpnet.h" #if defined __linux__ || defined __linux +#include "logger.h" + #include -#include +#include +#include #include + +#if defined(M_TCPOK) && !defined(ANDROID) +#include +#else +// using manual hack, because in this mode linux/tcp.h compiled with errors +#include +// Use linear timeouts for thin streams +#define TCP_THIN_LINEAR_TIMEOUTS 16 +// Fast retrans. after 1 dupack +#define TCP_THIN_DUPACK 17 +#endif + #endif #include "debug.h" @@ -67,8 +82,6 @@ int TcpNet::resolveHost(IPaddress *address, const char *host, Uint16 port) return SDLNet_ResolveHost(address, host, port); } -#include "logger.h" - TcpNet::Socket TcpNet::open(IPaddress *ip) { TcpNet::Socket sock = SDLNet_TCP_Open(ip); -- cgit v1.2.3-70-g09d2