Click here to Skip to main content
16,020,253 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question_getcwd Pin
stevelam21-Aug-06 10:10
stevelam21-Aug-06 10:10 
AnswerRe: _getcwd Pin
Chris Losinger21-Aug-06 10:15
professionalChris Losinger21-Aug-06 10:15 
AnswerRe: _getcwd Pin
Joe Woodbury21-Aug-06 19:16
professionalJoe Woodbury21-Aug-06 19:16 
QuestionHow to detect completion of Socket recv() function. Pin
Robert Palma Jr.21-Aug-06 10:01
Robert Palma Jr.21-Aug-06 10:01 
AnswerRe: How to detect completion of Socket recv() function. Pin
zzattack21-Aug-06 12:05
zzattack21-Aug-06 12:05 
GeneralRe: How to detect completion of Socket recv() function. Pin
Robert Palma Jr.22-Aug-06 6:28
Robert Palma Jr.22-Aug-06 6:28 
GeneralRe: How to detect completion of Socket recv() function. Pin
Robert Palma Jr.22-Aug-06 9:56
Robert Palma Jr.22-Aug-06 9:56 
GeneralRe: How to detect completion of Socket recv() function. Pin
zzattack22-Aug-06 10:14
zzattack22-Aug-06 10:14 
Haha, cool, good to hear. I'll try to explain how I think it works.

Actually your recv() function returns when it has read what you wanted (like 4096 or 8192 bytes etc.), or if the connection closes. But, if there's not enough data left to fill the buffer (eof), recv() keeps waiting, and the connection remains opened so that more data can be sent and added to the buffer later.

By default on HTTP/1.0 the connection is closed, but with HTTP/1.1 it remains opened unless "Connection: close" was sent along with the headers. Therefor, recv() returns only when the server closes the connection because of a timeout. That might take minutes, and your code inded appears to hang Frown | :(

I meant I have no c/c++ experience, only a bit of the HTTP protocol which I learned fom mIRC scripting. I was actually looking at the boards for tutorials Smile | :) . Anyway, have fun.
AnswerRe: How to detect completion of Socket recv() function. Pin
Ajesh.Sreevalsa21-Aug-06 18:44
Ajesh.Sreevalsa21-Aug-06 18:44 
GeneralRe: How to detect completion of Socket recv() function. Pin
Robert Palma Jr.22-Aug-06 6:26
Robert Palma Jr.22-Aug-06 6:26 
QuestionWhere to execute constructor? Pin
Oliver12321-Aug-06 9:37
Oliver12321-Aug-06 9:37 
AnswerRe: Where to execute constructor? Pin
Wes Aday21-Aug-06 9:47
professionalWes Aday21-Aug-06 9:47 
GeneralRe: Where to execute constructor? Pin
Oliver12321-Aug-06 11:19
Oliver12321-Aug-06 11:19 
GeneralRe: Where to execute constructor? Pin
Wes Aday21-Aug-06 11:24
professionalWes Aday21-Aug-06 11:24 
GeneralRe: Where to execute constructor? Pin
Oliver12321-Aug-06 12:00
Oliver12321-Aug-06 12:00 
GeneralRe: Where to execute constructor? Pin
Wes Aday21-Aug-06 12:03
professionalWes Aday21-Aug-06 12:03 
GeneralRe: Where to execute constructor? Pin
Rudolf Jan22-Aug-06 0:19
Rudolf Jan22-Aug-06 0:19 
GeneralRe: Where to execute constructor? Pin
Oliver12322-Aug-06 11:44
Oliver12322-Aug-06 11:44 
GeneralRe: Where to execute constructor? Pin
Oliver12322-Aug-06 16:28
Oliver12322-Aug-06 16:28 
QuestionDesign Patterns : Command Pattern? Pin
brodies21-Aug-06 9:15
brodies21-Aug-06 9:15 
AnswerRe: Design Patterns : Command Pattern? Pin
Neville Franks21-Aug-06 11:24
Neville Franks21-Aug-06 11:24 
QuestionWord automation question with NO MFC Pin
great_tommy21-Aug-06 8:42
great_tommy21-Aug-06 8:42 
QuestionRun time library Pin
Waldermort21-Aug-06 7:33
Waldermort21-Aug-06 7:33 
AnswerRe: Run time library Pin
Zac Howland21-Aug-06 8:27
Zac Howland21-Aug-06 8:27 
GeneralRe: Run time library Pin
Waldermort21-Aug-06 8:52
Waldermort21-Aug-06 8:52 

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.