1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

gettin the private address

Discussion in 'C' started by juliaprocess, Dec 19, 2006.

  1. juliaprocess

    juliaprocess New Member

    Joined:
    Aug 16, 2006
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    hello,

    how do i find my private address assigned by the NAT box? Like when you type ipconfig

    I can get the public address and I tried to use getsockName to get the private, but it just returns the 127.0.0...... instead of what the nat assigned, i looked for it all over the place , any suggestions?
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    I'm working off a memory that's reaching far into the past. Have you tried "gethostbyname" or "getaddr info"?
     
  3. juliaprocess

    juliaprocess New Member

    Joined:
    Aug 16, 2006
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
  4. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    Excellent, thanks for providing the link. Incidentally, the structures used by the functions I mentioned are equipped to store multiple names and addresses, if I recall correctly. Have you read Beej's stuff on socket programming? It primarily addresses the issue from the point of Unix derivatives, but almost everything there is applicable to Windows, as well, and he even has some commentary regarding that.
     

Share This Page