Click here to Skip to main content
15,913,773 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: TCP client/server data exchange Pin
bigdenny20014-Nov-07 11:19
bigdenny20014-Nov-07 11:19 
GeneralRe: TCP client/server data exchange Pin
Jörgen Sigvardsson14-Nov-07 21:35
Jörgen Sigvardsson14-Nov-07 21:35 
GeneralRe: TCP client/server data exchange Pin
Mark Salsbery14-Nov-07 11:41
Mark Salsbery14-Nov-07 11:41 
GeneralRe: TCP client/server data exchange Pin
JudyL_MD15-Nov-07 3:03
JudyL_MD15-Nov-07 3:03 
GeneralRe: TCP client/server data exchange Pin
Mark Salsbery15-Nov-07 5:43
Mark Salsbery15-Nov-07 5:43 
GeneralRe: TCP client/server data exchange Pin
JudyL_MD15-Nov-07 6:01
JudyL_MD15-Nov-07 6:01 
GeneralRe: TCP client/server data exchange Pin
Mark Salsbery15-Nov-07 6:30
Mark Salsbery15-Nov-07 6:30 
GeneralRe: TCP client/server data exchange Pin
JudyL_MD15-Nov-07 6:52
JudyL_MD15-Nov-07 6:52 
Can you try calling WSAGetLastError after you receive the partial bytes? I'm curious if it is set to show the timeout. According to the documentation, recv should either read all or timeout. The docs do say:

Windows Sockets 2 does not define any standard blocking time-out mechanism for this function

I think we're hitting this case - the receive has timed out and who knows how the function is reporting the timeout. I think we can safely say the following:

For a blocking socket, you need to check the result from the recv and if you don't get the requested number of bytes, you have hit the timeout condition and need to handle it accordingly.

Judy
GeneralRe: TCP client/server data exchange Pin
Mark Salsbery15-Nov-07 7:10
Mark Salsbery15-Nov-07 7:10 
GeneralRe: TCP client/server data exchange Pin
JudyL_MD15-Nov-07 7:25
JudyL_MD15-Nov-07 7:25 
GeneralRe: TCP client/server data exchange Pin
Mark Salsbery15-Nov-07 7:36
Mark Salsbery15-Nov-07 7:36 
GeneralRe: TCP client/server data exchange Pin
Mark Salsbery15-Nov-07 7:14
Mark Salsbery15-Nov-07 7:14 
GeneralRe: TCP client/server data exchange Pin
JudyL_MD15-Nov-07 7:27
JudyL_MD15-Nov-07 7:27 
GeneralRe: TCP client/server data exchange Pin
Mark Salsbery15-Nov-07 7:36
Mark Salsbery15-Nov-07 7:36 
GeneralRe: TCP client/server data exchange Pin
JudyL_MD15-Nov-07 2:59
JudyL_MD15-Nov-07 2:59 
QuestionWeird namespace alias resolution problem in VC++ 2003 Pin
Orhun Birsoy14-Nov-07 8:42
Orhun Birsoy14-Nov-07 8:42 
AnswerRe: Weird namespace alias resolution problem in VC++ 2003 Pin
Mark Salsbery14-Nov-07 9:30
Mark Salsbery14-Nov-07 9:30 
AnswerRe: Weird namespace alias resolution problem in VC++ 2003 [modified] Pin
snowfall114-Nov-07 16:39
snowfall114-Nov-07 16:39 
QuestionAppoint help: [modified] Pin
Hakan Bulut14-Nov-07 6:37
Hakan Bulut14-Nov-07 6:37 
AnswerRe: Appoint help: Pin
Janzen14-Nov-07 7:14
Janzen14-Nov-07 7:14 
GeneralRe: Appoint help: Pin
Hakan Bulut14-Nov-07 7:34
Hakan Bulut14-Nov-07 7:34 
GeneralRe: Appoint help: Pin
led mike14-Nov-07 7:48
led mike14-Nov-07 7:48 
GeneralRe: Appoint help: Pin
Mark Salsbery14-Nov-07 8:02
Mark Salsbery14-Nov-07 8:02 
GeneralRe: Appoint help: Pin
Hakan Bulut14-Nov-07 8:05
Hakan Bulut14-Nov-07 8:05 
GeneralRe: Appoint help: Pin
led mike14-Nov-07 8:51
led mike14-Nov-07 8:51 

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.