In our program, communication is happening over unix domain socket. When socket is created we are enabling socket option SO_KEEPALIVE on the socket. Call to setsockopt()
is successful but netstats
output doesn't so it. Output is as follows.
tcp 0 0 nemo:diamServ nemo:15388 ESTABLISHED 19997/process_name keepalive (7221.16/0/0)
unix 3 [ ] STREAM CONNECTED 228473 19997/process_name /tmp/uds1.socket
In above output we can see that "keepalive" keyword for tcp socket but for unix socket this keyword is not there. We are not sure whether keepalive is enabled for unix socket or not?
Note that diamServ is the service name corresponding to the port used for tcp socket. and /tmp/uds1.socket is unix socket file generated.