summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/localconsts.h1
-rw-r--r--src/net/sdltcpnet.cpp19
2 files changed, 17 insertions, 3 deletions
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 <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);