Click here to Skip to main content
15,893,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Break point not hit error in VC2005 Pin
T210224-Jan-11 19:50
T210224-Jan-11 19:50 
GeneralMessage Removed Pin
24-Jan-11 20:07
Jia10024-Jan-11 20:07 
GeneralRe: Break point not hit error in VS2005 Pin
T210224-Jan-11 22:51
T210224-Jan-11 22:51 
AnswerRe: Break point not hit error in VS2005 Pin
Stefan_Lang27-Jan-11 2:33
Stefan_Lang27-Jan-11 2:33 
GeneralMessage Removed Pin
27-Jan-11 18:00
Jia10027-Jan-11 18:00 
GeneralRe: Break point not hit error in VS2005 Pin
Stefan_Lang27-Jan-11 22:34
Stefan_Lang27-Jan-11 22:34 
GeneralMessage Removed Pin
28-Jan-11 16:49
Jia10028-Jan-11 16:49 
GeneralRe: Break point not hit error in VS2005 Pin
Stefan_Lang30-Jan-11 22:59
Stefan_Lang30-Jan-11 22:59 
QuestionHow to display a image in an Activex webpage Pin
simon alec smith24-Jan-11 9:48
simon alec smith24-Jan-11 9:48 
AnswerRe: How to display a image in an Activex webpage Pin
Richard MacCutchan24-Jan-11 10:27
mveRichard MacCutchan24-Jan-11 10:27 
GeneralRe: How to display a image in an Activex webpage Pin
yindoor24-Jan-11 16:42
yindoor24-Jan-11 16:42 
GeneralRe: How to display a image in an Activex webpage Pin
Richard MacCutchan24-Jan-11 21:17
mveRichard MacCutchan24-Jan-11 21:17 
QuestionTCP/IP client / serveur and Win7 Pin
shoppinit24-Jan-11 7:52
shoppinit24-Jan-11 7:52 
AnswerRe: TCP/IP client / serveur and Win7 Pin
TheGreatAndPowerfulOz24-Jan-11 8:22
TheGreatAndPowerfulOz24-Jan-11 8:22 
GeneralRe: TCP/IP client / serveur and Win7 Pin
shoppinit24-Jan-11 9:37
shoppinit24-Jan-11 9:37 
GeneralRe: TCP/IP client / serveur and Win7 Pin
TheGreatAndPowerfulOz25-Jan-11 13:31
TheGreatAndPowerfulOz25-Jan-11 13:31 
GeneralRe: TCP/IP client / serveur and Win7 Pin
shoppinit25-Jan-11 21:55
shoppinit25-Jan-11 21:55 
Thanks for your suggestion. The configuration seems to be OK. In any case, the port and IP is set correctly. Bizarrely currports show that the server is listening and that the connection is established on the client, but accept never unblocks.

I have now rewritten the client code using getaddrinfo() to request the socket and now it works. Inexplicably, it now works even though I am still connecting with the same socket and address.

I am curious to know why it works OK on XP but not Win7 in case I have future problems. I will post the server and client code snippets to see if you can see where the problem is.

Server:


err = WSAStartup( wVersionRequested, &wsaData );
sin.sin_addr.s_addr = htonl(INADDR_ANY);
sin.sin_port		= htons(port);

sock = socket(AF_INET, SOCK_STREAM, 0); //Tried IPPROTO_TCP, too. 

qtest = bind(sock, (SOCKADDR *)&sin, sizeof(sin));

result = setsockopt(sock,  SOL_SOCKET,   SO_REUSEADDR,   (char *) &flag,  sizeof(int));  
...
test = listen(m_sock->get_sock(), 0);

m_sock->set_com_sock(accept(m_sock->get_sock(), (SOCKADDR *)&m_sock->get_sin(), &sinsize));



Client:


sin.sin_family	= AF_INET; 

WSAStartup(MAKEWORD(2,0), &WSAData);

sock = socket(AF_INET,SOCK_STREAM,0);

err = bind(sock, (SOCKADDR *)&sin, sizeof(sin));

err = connect(sock, (SOCKADDR *)&sin, sizeof(sin));

AnswerRe: TCP/IP client / serveur and Win7 Pin
Richard MacCutchan24-Jan-11 10:30
mveRichard MacCutchan24-Jan-11 10:30 
Questionwhat is the type of this pointer and also object? Pin
aesthetic.crazy24-Jan-11 4:50
aesthetic.crazy24-Jan-11 4:50 
AnswerRe: what is the type of this pointer and also object? Pin
Richard MacCutchan24-Jan-11 5:06
mveRichard MacCutchan24-Jan-11 5:06 
GeneralRe: what is the type of this pointer and also object? Pin
CPallini24-Jan-11 5:30
mveCPallini24-Jan-11 5:30 
GeneralRe: what is the type of this pointer and also object? Pin
aesthetic.crazy25-Jan-11 0:08
aesthetic.crazy25-Jan-11 0:08 
GeneralRe: what is the type of this pointer and also object? Pin
Richard MacCutchan25-Jan-11 2:31
mveRichard MacCutchan25-Jan-11 2:31 
AnswerRe: what is the type of this pointer and also object? PinPopular
Aescleal24-Jan-11 5:37
Aescleal24-Jan-11 5:37 
GeneralRe: what is the type of this pointer and also object? Pin
Chris Meech24-Jan-11 9:47
Chris Meech24-Jan-11 9:47 

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.