Home
Tutorials
Code Snippets
Code Samples
Downloads
Links

The Blog
Our Projects
About
Contact

::Add RageStorm to Favorites!::

The Blog | Our Projects | Guest Book | About | Contact

 
Code Snippet - Socket to IP
Author:Arkon
Category:Internet & Networks
File Size:207 Bytes
Uploaded at:25-Apr-03 04:20:03 pm
Description:
  Get the IP a socket connected to.
  
// Don't forget to init the sockets DLL!
char* SocktoIP(SOCKET s)
{
 SOCKADDR_IN saddr;
 int so = sizeof(saddr);
 getsockname(s, (SOCKADDR*)&saddr, &so);
 return(inet_ntoa((in_addr)saddr.sin_addr));
}
NOTE:
Comments that will hurt anyone in any way will be deleted.
Don't ask for features, advertise or curse.
If you want to leave a message to the author use the contacts,
if you have any question in relation to your comments please use the forum.
Comments which violate any of these requests will be deleted without further
notice. Use the comment system decently.

Post your comment:
Name:
email:
Comment:
::Top 5 Tutorials::
Embedded Python[116959]
2D Rotated Rectangles Collision Detection[88970]
Keyboard Hook[77295]
UDP[65815]
HTTP Proxy[41203]

::Top 5 Samples::
2D ColDet Rotated Rectangles[11560]
PS2 Mouse Driver[6956]
Wave Format Player[5791]
Reading FAT12[5619]
CodeGuru[5358]


All rights reserved to RageStorm © 2009