> Interesting. Two people have said wait on the handle, a third said
> call
> GetOverlappedResult() and let that wait for it to finish.

If the third is me, then I refrain to accept it!  I merely pointed out that
using false as the last parameter makes the loop hog the CPU.  I'd also wait
on the handle, to be able to set a timeout.

> Does anyone want to change their mind? Are those two methods equally
> as valid, or might one have any kind of advantage?
> Note that I do not want this thread to hang caused by waiting for
> bytes that never come... waiting on the handle with a timeout sounds
> safer?

They're both valid, of course, but for different cases.  I can't see any way
to set a timeout (that you definitely need) using GetOverlappedResult( ).
Indeed you can't wait on something that might never happen.

-------------
Ehsan Akhgari

Farda Technology (http://www.farda-tech.com/)

List Owner: [email protected]

[ Email: [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]

Close your eyes, and imagine to be without what we take for granted every
time we open our eyes...




_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
subscription changes, and list archive.

Reply via email to