In sendto
:
ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
const struct sockaddr *dest_addr, socklen_t addrlen);
From this call I have the socket descriptor of the sending socket, is there a way to get the socket descriptor of the receiver from const struct sockaddr *dest_addr
No. It is not possible. The socket descriptor you are asking to be retrieved is the socket descriptor of the receiver which for all that we know may be in some other process running in a totally different machine.
Also, I can't think of a reason as to what can be achieved by getting that socket descriptor.