Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
E

evilsocket

@evilsocket
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • c++ network library
    E evilsocket

    I think the ACE Framework it's the best around here ... try that : http://www.cs.wustl.edu/~schmidt/ACE.html

    C / C++ / MFC c++ sysadmin question

  • Detecting Local IP Address
    E evilsocket

    Assuming that you have only one network interface (your eth card) and a loopback interface (127.0.0.1), i think you could try to get the name of the local computer, and then resolve it in an ip address . char szMyComputerName[0xFF] = {0}, szMyIpAddress[0xFF] = {0}; DWORD dwSize = 0xFF; ::GetComputerName(szMyComputerName,&dwSize); Now all you have to to is to resolve 'szMyComputerName' as you did in your example . Naturally, if you have more than one network interface (eth card, wireless, etc), you have to enumerate them and then you choose the one you want to work on : SOCKET sd = WSASocket(AF_INET, SOCK_DGRAM, 0, 0, 0, 0); INTERFACE_INFO InterfaceList[20]; unsigned long nBytesReturned; WSAIoctl( sd, SIO_GET_INTERFACE_LIST, 0, 0, &InterfaceList, sizeof(InterfaceList), &nBytesReturned, 0, 0); for( int i = 0; i < nBytesReturned / sizeof(INTERFACE_INFO); i++ ) { printf( "Interface[%d] : %s\n",i, inet_ntoa( ((sockaddr_in *)&(InterfaceList[i].iiAddress))->sin_addr ) ) } Hope i helped ....:)

    C / C++ / MFC sysadmin tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups