My program opens a socket with this function:
sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)
After finish sending data the socket is closed:
close(sockfd);
But the issue is when the program doesn't run well and is blocking. Thereby the socket will not be closed.
How can I check all sockets opened under Linux OS ?