watchdog kni sockfd 设置非阻塞
This commit is contained in:
@@ -33,6 +33,8 @@ static int watchdog_kni_fd_create()
|
|||||||
unsigned int tcp_keepintvl = 1;
|
unsigned int tcp_keepintvl = 1;
|
||||||
unsigned int tcp_keepidle = 1;
|
unsigned int tcp_keepidle = 1;
|
||||||
|
|
||||||
|
evutil_make_socket_nonblocking(fd);
|
||||||
|
|
||||||
if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (const void *) &so_keepalive, sizeof(int)) == -1)
|
if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (const void *) &so_keepalive, sizeof(int)) == -1)
|
||||||
{
|
{
|
||||||
TFE_LOG_ERROR(g_default_logger, "watchdog fd setup setsockopt(SO_KEEPALIVE, %d) failed : %s",
|
TFE_LOG_ERROR(g_default_logger, "watchdog fd setup setsockopt(SO_KEEPALIVE, %d) failed : %s",
|
||||||
|
|||||||
Reference in New Issue
Block a user