Open edineshkumar opened 3 years ago
Yep, this is a unix domain socket - so the TCP sockopts do not apply here.
More generally though: there's no such thing as a keepalive for an AF_UNIX
socket anyway. Can you explain a little about what you're trying to achieve here?
How can I configure keepalive in unix domain socket for 120sec time period ?
I tried below steps in nbd-proxy.c file, under
static int open_nbd_socket(struct ctx *ctx)
function:After
socket( );
int idle = 120, interval = 5, maxpkt = 5, optval=1; step 1:
setsockopt(sd, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optlval));
// Enabling Keepalive step 2:setsockopt(sd, SOL_TCP, TCP_KEEPIDLE, &idle, sizeof(idle) );
// Overwrite keepidle from default. step 3:setsockopt(sd, SOL_TCP, TCP_KEEPINTVL, &interval, sizeof(interval) );
// Overwrite keepintvl from default. step 4:setsockopt(sd, SOL_TCP, TCP_KEEPCNT, &maxpkt, sizeof(maxpkt) );
// Overwrite keepcnt from default.Enabling
SO_KEEPALIVE
has been success, but over writeTCP_KEEPIDLE
TCP_KEEPINTVL
andTCP_KEEPCNT
is not getting success, I am getting error like 'Operation not supported' .Kindly give some inputs to configuring the same .