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

C / C++ / MFC

 
Questiona very strange problem about socket Pin
kcynic11-Aug-07 1:50
kcynic11-Aug-07 1:50 
AnswerRe: a very strange problem about socket Pin
Mark Salsbery11-Aug-07 6:46
Mark Salsbery11-Aug-07 6:46 
GeneralRe: a very strange problem about socket Pin
David Crow11-Aug-07 12:40
David Crow11-Aug-07 12:40 
GeneralRe: a very strange problem about socket Pin
Mark Salsbery12-Aug-07 7:42
Mark Salsbery12-Aug-07 7:42 
GeneralRe: a very strange problem about socket Pin
kcynic11-Aug-07 18:45
kcynic11-Aug-07 18:45 
GeneralRe: a very strange problem about socket Pin
Mark Salsbery12-Aug-07 6:53
Mark Salsbery12-Aug-07 6:53 
GeneralRe: a very strange problem about socket Pin
kcynic12-Aug-07 9:59
kcynic12-Aug-07 9:59 
GeneralRe: a very strange problem about socket Pin
Mark Salsbery12-Aug-07 10:16
Mark Salsbery12-Aug-07 10:16 
kcynic wrote:
when I test the guide of you given,the SockAddrStr always be fill with "0.0.0.0"!why?

Because you haven't specifically bound the socket to one adapter - there's no specific
IP address.

If you want the IP address(es) of the machine, you can use the sockets APIs gethostname()
and gehostbyname() (or the newer getaddrinfo()).  Note that you can only get a local LAN IP
address if you're on a LAN, not the public IP needed by peers outside the LAN.

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: a very strange problem about socket Pin
kcynic12-Aug-07 10:32
kcynic12-Aug-07 10:32 
QuestionHow can fix linking errors? Pin
Armin Morattab11-Aug-07 0:36
Armin Morattab11-Aug-07 0:36 
AnswerRe: How can fix linking errors? Pin
karle12-Aug-07 7:30
karle12-Aug-07 7:30 
QuestionRetrieve static text from other application window Pin
Daboe_10-Aug-07 23:19
Daboe_10-Aug-07 23:19 
AnswerRe: Retrieve static text from other application window Pin
Peter Weyzen11-Aug-07 15:21
Peter Weyzen11-Aug-07 15:21 
GeneralRe: Retrieve static text from other application window Pin
Daboe_12-Aug-07 1:50
Daboe_12-Aug-07 1:50 
QuestionDialog Communication Pin
sofa_2006au10-Aug-07 22:12
sofa_2006au10-Aug-07 22:12 
QuestionRe: Dialog Communication Pin
Hamid_RT11-Aug-07 0:46
Hamid_RT11-Aug-07 0:46 
AnswerRe: Dialog Communication Pin
sofa_2006au11-Aug-07 2:22
sofa_2006au11-Aug-07 2:22 
QuestionRe: Dialog Communication Pin
Hamid_RT11-Aug-07 8:16
Hamid_RT11-Aug-07 8:16 
QuestionRe: Dialog Communication Pin
David Crow11-Aug-07 6:39
David Crow11-Aug-07 6:39 
AnswerRe: Dialog Communication Pin
Peter Weyzen11-Aug-07 15:24
Peter Weyzen11-Aug-07 15:24 
GeneralRe: Dialog Communication Pin
sofa_2006au11-Aug-07 16:21
sofa_2006au11-Aug-07 16:21 
GeneralRe: Dialog Communication Pin
Peter Weyzen11-Aug-07 19:02
Peter Weyzen11-Aug-07 19:02 
QuestionClosing a Dialog Pin
Sangeetha_J10-Aug-07 19:17
Sangeetha_J10-Aug-07 19:17 
AnswerRe: Closing a Dialog Pin
Hamid_RT10-Aug-07 20:06
Hamid_RT10-Aug-07 20:06 
GeneralRe: Closing a Dialog Pin
Sangeetha_J10-Aug-07 23:09
Sangeetha_J10-Aug-07 23:09 

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.