Archived

This topic is now archived and is closed to further replies.

Determine Internet IP from Socket :: Winsock

This topic is 5672 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. Given an active socket, what is the best way to determine the IP property of that socket? For example, let say I have an ftp server. When a connection is made with a client and the socket for that client is active, how do you determine the client''s IP address? My initial idea right now is to us getpeername(), which returns the socket''s sockaddr. Once you have a pointer to a sockaddr structure, you then determine the IP using getnameinfo(). Thanks, Kuphryn

Share this post


Link to post
Share on other sites