if you have a socket handle how can you know the IP of it in C or C++
if you have a socket handle how can you know the IP of it in C or C++
Last edited by elitesyntax; 03-28-2004 at 08:04 PM.
Compiler Gcc
sockaddr structure will hold all that information. Read up on it.
When you call the accept() function the second parameter (i think) is a pointer to a sockaddr structure to fill with the information regarding the connecting device.
-Dan
I think that he is referring to,"How can I, with just a socket handle, get the ip address"....Originally Posted by codec
to be honest, I dont know, after looking through some unix man pages, I cannot find any function that will return the address of the other side of a socket.
Under Win32 platform, definitely. I am not familiar on the UNIX platform.
Kuphryn