Find IP address from remote end of a TCP socket

0

In C or C++ it is fairly simple to find the IP address of the remote end of a TCP socket.

The following example shows how to do this using the getpeername() and inet_ntoa() system calls.

Share.