summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-12 19:52:03 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-12 21:23:40 +0300
commitc565936b3ac5b6e1ab0d5ca30963619c7b725bb6 (patch)
tree8e15e8d1ce53622414aa6caeca2b8fa2b0801e1c /src/net
parent351821c1f18f9285be58df0a05339936311f6490 (diff)
downloadManaVerse-c565936b3ac5b6e1ab0d5ca30963619c7b725bb6.tar.gz
ManaVerse-c565936b3ac5b6e1ab0d5ca30963619c7b725bb6.tar.bz2
ManaVerse-c565936b3ac5b6e1ab0d5ca30963619c7b725bb6.tar.xz
ManaVerse-c565936b3ac5b6e1ab0d5ca30963619c7b725bb6.zip
fix tcp tuning options usage.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/sdltcpnet.cpp19
1 files changed, 16 insertions, 3 deletions
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 <sys/socket.h>
-#include <linux/tcp.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
#include <netdb.h>
+
+#if defined(M_TCPOK) && !defined(ANDROID)
+#include <linux/tcp.h>
+#else
+// using manual hack, because in this mode linux/tcp.h compiled with errors
+#include <netinet/tcp.h>
+// 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);