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

C / C++ / MFC

 
AnswerRe: VC++ console application - client / Server Pin
Richard MacCutchan21-Sep-14 0:56
mveRichard MacCutchan21-Sep-14 0:56 
GeneralRe: VC++ console application - client / Server Pin
Pouria Polouk21-Sep-14 4:59
Pouria Polouk21-Sep-14 4:59 
GeneralRe: VC++ console application - client / Server Pin
Richard MacCutchan21-Sep-14 7:55
mveRichard MacCutchan21-Sep-14 7:55 
GeneralRe: VC++ console application - client / Server Pin
Pouria Polouk21-Sep-14 8:46
Pouria Polouk21-Sep-14 8:46 
QuestionRe: VC++ console application - client / Server Pin
David Crow21-Sep-14 14:23
David Crow21-Sep-14 14:23 
AnswerRe: VC++ console application - client / Server Pin
Pouria Polouk22-Sep-14 3:27
Pouria Polouk22-Sep-14 3:27 
AnswerRe: VC++ console application - client / Server Pin
Albert Holguin22-Sep-14 3:45
professionalAlbert Holguin22-Sep-14 3:45 
GeneralRe: VC++ console application - client / Server Pin
Pouria Polouk22-Sep-14 4:46
Pouria Polouk22-Sep-14 4:46 
GeneralRe: VC++ console application - client / Server Pin
Richard MacCutchan22-Sep-14 6:25
mveRichard MacCutchan22-Sep-14 6:25 
QuestionRe: VC++ console application - client / Server Pin
jeron122-Sep-14 6:31
jeron122-Sep-14 6:31 
AnswerRe: VC++ console application - client / Server Pin
Pouria Polouk22-Sep-14 6:50
Pouria Polouk22-Sep-14 6:50 
GeneralRe: VC++ console application - client / Server Pin
jeron122-Sep-14 6:55
jeron122-Sep-14 6:55 
GeneralRe: VC++ console application - client / Server Pin
Pouria Polouk23-Sep-14 22:34
Pouria Polouk23-Sep-14 22:34 
GeneralRe: VC++ console application - client / Server Pin
jeron124-Sep-14 3:58
jeron124-Sep-14 3:58 
GeneralRe: VC++ console application - client / Server Pin
Pouria Polouk24-Sep-14 8:19
Pouria Polouk24-Sep-14 8:19 
GeneralRe: VC++ console application - client / Server Pin
jeron124-Sep-14 9:16
jeron124-Sep-14 9:16 
GeneralRe: VC++ console application - client / Server Pin
Pouria Polouk25-Sep-14 5:33
Pouria Polouk25-Sep-14 5:33 
Dear friend, It’s not important if that public IP (ADSL IP) be static or dynamic. The code below gets public IP of that computer and it must be able bind that IP to the created socket and then stays at the listening state:

...
HINTERNET hI, hF;
DWORD piSize;
char public_ip[15];
hI= InternetOpen(NULL, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
hF = InternetOpenUrlA(hI, "http://myip.dnsomatic.com", NULL, 0, INTERNET_FLAG_RELOAD, 0);
InternetReadFile(hF, &public_ip, sizeof(public_ip), &piSize);
public_ip[piSize] = '\0';
InternetCloseHandle(hF);
InternetCloseHandle(hI);
cout << public_ip;
...

The main problem is that my server program can’t bind to received public IP.
QuestionRe: VC++ console application - client / Server Pin
jeron125-Sep-14 11:53
jeron125-Sep-14 11:53 
AnswerRe: VC++ console application - client / Server Pin
Pouria Polouk26-Sep-14 7:25
Pouria Polouk26-Sep-14 7:25 
GeneralRe: VC++ console application - client / Server Pin
jeron126-Sep-14 7:41
jeron126-Sep-14 7:41 
QuestionRegarding Parameter in C (GCD of 2 Numbers) Pin
Driganka Mandal19-Sep-14 19:02
Driganka Mandal19-Sep-14 19:02 
AnswerRe: Regarding Parameter in C (GCD of 2 Numbers) Pin
Richard MacCutchan19-Sep-14 21:17
mveRichard MacCutchan19-Sep-14 21:17 
GeneralRe: Regarding Parameter in C (GCD of 2 Numbers) Pin
Driganka Mandal19-Sep-14 22:18
Driganka Mandal19-Sep-14 22:18 
GeneralRe: Regarding Parameter in C (GCD of 2 Numbers) Pin
Richard MacCutchan19-Sep-14 22:23
mveRichard MacCutchan19-Sep-14 22:23 
AnswerRe: Regarding Parameter in C (GCD of 2 Numbers) Pin
Albert Holguin22-Sep-14 3:41
professionalAlbert Holguin22-Sep-14 3:41 

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.