|
@@ -144,7 +144,7 @@ private:
|
|
fd_set _readfds;
|
|
fd_set _readfds;
|
|
fd_set _writefds;
|
|
fd_set _writefds;
|
|
#if defined(_WIN32) || defined(_WIN64)
|
|
#if defined(_WIN32) || defined(_WIN64)
|
|
- fd_set _exceptfds;
|
|
|
|
|
|
+ fd_set _exceptfds;
|
|
#endif
|
|
#endif
|
|
long _nfds;
|
|
long _nfds;
|
|
|
|
|
|
@@ -152,13 +152,15 @@ private:
|
|
ZT_PHY_SOCKFD_TYPE _whackSendSocket;
|
|
ZT_PHY_SOCKFD_TYPE _whackSendSocket;
|
|
|
|
|
|
bool _noDelay;
|
|
bool _noDelay;
|
|
|
|
+ bool _noCheck;
|
|
|
|
|
|
public:
|
|
public:
|
|
/**
|
|
/**
|
|
* @param handler Pointer of type HANDLER_PTR_TYPE to handler
|
|
* @param handler Pointer of type HANDLER_PTR_TYPE to handler
|
|
* @param noDelay If true, disable TCP NAGLE algorithm on TCP sockets
|
|
* @param noDelay If true, disable TCP NAGLE algorithm on TCP sockets
|
|
|
|
+ * @param noCheck If true, attempt to set UDP SO_NO_CHECK option to disable sending checksums
|
|
*/
|
|
*/
|
|
- Phy(HANDLER_PTR_TYPE handler,bool noDelay) :
|
|
|
|
|
|
+ Phy(HANDLER_PTR_TYPE handler,bool noDelay,bool noCheck) :
|
|
_handler(handler)
|
|
_handler(handler)
|
|
{
|
|
{
|
|
FD_ZERO(&_readfds);
|
|
FD_ZERO(&_readfds);
|
|
@@ -202,6 +204,7 @@ public:
|
|
_whackReceiveSocket = pipes[0];
|
|
_whackReceiveSocket = pipes[0];
|
|
_whackSendSocket = pipes[1];
|
|
_whackSendSocket = pipes[1];
|
|
_noDelay = noDelay;
|
|
_noDelay = noDelay;
|
|
|
|
+ _noCheck = noCheck;
|
|
}
|
|
}
|
|
|
|
|
|
~Phy()
|
|
~Phy()
|
|
@@ -296,6 +299,11 @@ public:
|
|
#endif
|
|
#endif
|
|
#ifdef IP_MTU_DISCOVER
|
|
#ifdef IP_MTU_DISCOVER
|
|
f = 0; setsockopt(s,IPPROTO_IP,IP_MTU_DISCOVER,&f,sizeof(f));
|
|
f = 0; setsockopt(s,IPPROTO_IP,IP_MTU_DISCOVER,&f,sizeof(f));
|
|
|
|
+#endif
|
|
|
|
+#ifdef SO_NO_CHECK
|
|
|
|
+ if (_noCheck) {
|
|
|
|
+ f = 1; setsockopt(s,SOL_SOCKET,SO_NO_CHECK,(void *)&f,sizeof(f));
|
|
|
|
+ }
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
#endif // Windows or not
|
|
#endif // Windows or not
|