I’m trying to pass fd between process and I found the sample code like portlisten. In the sample, a recvmsg() can take a bound socket as parameter (and leave msghdr.msg_name as NULL) but the sendmsg() cannot – it must take a sockaddr* in the msghdr.msg_name.
I tried to modify the program by connecting first but failed, and found the comment as /* doesn't do anything at the moment but I don’t understand why.
Is this a limitation of sendmsg() that it cannot take an already connected socket as parameter?
Look at the source code of libancillary. I can’t post a link because I’m a new user, but you’ll find it on Google.