|
Prevent stealing of sockets
I am writing a tcp - ip application. Is there any way I can prevent a socket (or an active connection) from being stolen by another program?
For example : s = socket(AF_INET,SOCK_STREAM,0), here s is the descriptor for the socket. And if another program running on my machine steals the file descriptor, it can potentially start communicating with the server on the port that is bound to this socket later on.
I tried doing a google search and came across setsockopt() system call. In windows there seems to be an option called "SO_EXCLUSIVEADDRUSE". I could not find this option listed in <sys/socket.h>
Thanks in advance.
|