mirror of https://mirror.osredm.com/root/redis.git
Merge b44bafc76b
into 6995d8ac17
This commit is contained in:
commit
4127ce5f3a
|
@ -174,6 +174,7 @@ int anetKeepAlive(char *err, int fd, int interval)
|
|||
}
|
||||
|
||||
intvl = idle/3;
|
||||
if (intvl < 10) intvl = 10; /* kernel expects at least 10 seconds */
|
||||
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &intvl, sizeof(intvl))) {
|
||||
anetSetError(err, "setsockopt TCP_KEEPINTVL: %s\n", strerror(errno));
|
||||
return ANET_ERR;
|
||||
|
@ -196,9 +197,7 @@ int anetKeepAlive(char *err, int fd, int interval)
|
|||
|
||||
/* Note that the consequent probes will not be sent at equal intervals on Solaris,
|
||||
* but will be sent using the exponential backoff algorithm. */
|
||||
intvl = idle/3;
|
||||
cnt = 3;
|
||||
int time_to_abort = intvl * cnt;
|
||||
int time_to_abort = idle;
|
||||
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE_ABORT_THRESHOLD, &time_to_abort, sizeof(time_to_abort))) {
|
||||
anetSetError(err, "setsockopt TCP_KEEPCNT: %s\n", strerror(errno));
|
||||
return ANET_ERR;
|
||||
|
|
Loading…
Reference in New Issue