keep-alive 0.1.0.0 → 0.1.1.0
raw patch · 2 files changed
+41/−1 lines, 2 files
Files
- cbits/CKa.h +39/−0
- keep-alive.cabal +2/−1
+ cbits/CKa.h view
@@ -0,0 +1,39 @@+#ifndef CKA_H+#define CKA_H++#ifdef _WIN32+# include <winsock2.h>+# include <ws2tcpip.h>+# include <mswsock.h>+# include <Mstcpip.h>++#ifndef INLINE+# if defined(_MSC_VER)+# define INLINE extern __inline+# elif defined(__GNUC_GNU_INLINE__)+# define INLINE extern inline+# else+# define INLINE inline+# endif+#endif++INLINE int +winSetKeepAlive(int s, ULONG onoff, ULONG time, ULONG intvl) {++ struct tcp_keepalive ka;++ DWORD size;++ ka.onoff = onoff; + ka.keepalivetime = time;+ ka.keepaliveinterval = intvl;+ int sizeka = sizeof(ka);++ int rtn = WSAIoctl(s, SIO_KEEPALIVE_VALS, &ka, sizeka, NULL, 0, &size, NULL, NULL);++ return rtn;+};+#endif /* _WIN32 */++#endif /* CKA_H */+
keep-alive.cabal view
@@ -7,7 +7,7 @@ -- hash: e4fadd87f6fc7f6bca702c40ec776acd3dc1b4562423d193979808778831f6b8 name: keep-alive-version: 0.1.0.0+version: 0.1.1.0 homepage: https://github.com/3kyro/keep-alive#readme bug-reports: https://github.com/3kyro/keep-alive/issues author: Kyriakos Papachrysanthou@@ -26,6 +26,7 @@ extra-source-files: README.md ChangeLog.md+ cbits/CKa.h source-repository head type: git