Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get the Public and Private IP address of a Remote System? Pin
gloriousgopi16-Oct-06 4:28
gloriousgopi16-Oct-06 4:28 
QuestionRe: How to get the Public and Private IP address of a Remote System? Pin
David Crow16-Oct-06 5:00
David Crow16-Oct-06 5:00 
QuestionRe: How to get the Public and Private IP address of a Remote System? Pin
gloriousgopi16-Oct-06 18:09
gloriousgopi16-Oct-06 18:09 
QuestionRe: How to get the Public and Private IP address of a Remote System? Pin
David Crow17-Oct-06 2:42
David Crow17-Oct-06 2:42 
AnswerRe: How to get the Public and Private IP address of a Remote System? Pin
gloriousgopi17-Oct-06 19:08
gloriousgopi17-Oct-06 19:08 
GeneralRe: How to get the Public and Private IP address of a Remote System? Pin
Mark Salsbery16-Oct-06 6:51
Mark Salsbery16-Oct-06 6:51 
GeneralRe: How to get the Public and Private IP address of a Remote System? Pin
gloriousgopi16-Oct-06 20:26
gloriousgopi16-Oct-06 20:26 
GeneralRe: How to get the Public and Private IP address of a Remote System? Pin
Mark Salsbery17-Oct-06 6:06
Mark Salsbery17-Oct-06 6:06 
I understand what you want. You can't get it from outside the LAN. Maybe there's a way to
hack in to the router LOL. I would hope not.

Have your server (behind
the NAT) call gethostname(). That will give you the local (LAN) ip address. Send that address to your
client outside (on the WAN).
Call getpeername() from the client to get the server's public (WAN) ip address.


gloriousgopi wrote:
Actually, i got a requirement...


Not much you can do with that address from outside the LAN except display it.
Why the requirement? If you can be a little more specific maybe there's a solution.

Mark
GeneralRe: How to get the Public and Private IP address of a Remote System? Pin
gloriousgopi17-Oct-06 18:46
gloriousgopi17-Oct-06 18:46 
GeneralRe: How to get the Public and Private IP address of a Remote System? Pin
Mark Salsbery18-Oct-06 6:43
Mark Salsbery18-Oct-06 6:43 
QuestionRegular Expression in SQL Pin
Checker200316-Oct-06 2:55
Checker200316-Oct-06 2:55 
AnswerRe: Regular Expression in SQL Pin
David Crow16-Oct-06 3:03
David Crow16-Oct-06 3:03 
GeneralRe: Regular Expression in SQL Pin
Checker200316-Oct-06 3:05
Checker200316-Oct-06 3:05 
GeneralRe: Regular Expression in SQL Pin
Christian Graus16-Oct-06 5:36
protectorChristian Graus16-Oct-06 5:36 
AnswerRe: Regular Expression in SQL Pin
Mark Salsbery16-Oct-06 6:55
Mark Salsbery16-Oct-06 6:55 
QuestionAgain me ! Pin
Bravoone_200616-Oct-06 2:26
Bravoone_200616-Oct-06 2:26 
QuestionRe: Again me ! Pin
David Crow16-Oct-06 2:45
David Crow16-Oct-06 2:45 
AnswerRe: Again me ! Pin
Zac Howland16-Oct-06 3:29
Zac Howland16-Oct-06 3:29 
QuestionRe: Again me ! [modified] Pin
Bravoone_200616-Oct-06 19:21
Bravoone_200616-Oct-06 19:21 
AnswerRe: Again me ! Pin
David Crow17-Oct-06 5:22
David Crow17-Oct-06 5:22 
AnswerRe: Again me ! Pin
Bravoone_200617-Oct-06 20:55
Bravoone_200617-Oct-06 20:55 
QuestionRe: Again me ! Pin
David Crow18-Oct-06 2:50
David Crow18-Oct-06 2:50 
QuestionDeleting a text file after repalcing all char in a random number Pin
kamalesh8216-Oct-06 2:25
kamalesh8216-Oct-06 2:25 
QuestionRe: Deleting a text file after repalcing all char in a random number Pin
David Crow16-Oct-06 2:47
David Crow16-Oct-06 2:47 
AnswerRe: Deleting a text file after repalcing all char in a random number Pin
Steve S16-Oct-06 2:53
Steve S16-Oct-06 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.