Merge pull request #2409 from bmiklautz/tcp_user_timeout

core/tcp: set TCP_USER_TIMEOUT if available
This commit is contained in:
Norbert Federa 2015-02-23 11:00:06 +01:00
commit 31a75ea3e0
1 changed files with 11 additions and 0 deletions

View File

@ -1065,6 +1065,17 @@ BOOL freerdp_tcp_set_keep_alive_mode(int sockfd)
WLog_WARN(TAG, "setsockopt() SOL_SOCKET, SO_NOSIGPIPE");
}
#endif
#ifdef TCP_USER_TIMEOUT
optval = 4000;
optlen = sizeof(optval);
if (setsockopt(sockfd, SOL_TCP, TCP_USER_TIMEOUT, (void*) &optval, optlen) < 0)
{
WLog_WARN(TAG, "setsockopt() SOL_TCP, TCP_USER_TIMEOUT");
}
#endif
return TRUE;
}