المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Overlapped IO sockets sending and receiving at the same time



C++ Programming
11-17-2011, 07:34 AM
I'm writing some port forwarding code and don't have control over the size of the data being sent/received. So I need to always have a recv queued even though I may possible be in the middle of a write (since my overlapped sockets are reading and writing to and from each other whenever recv gets new data on either side).

How do I allow for the possibility that an unblocked worker thread could be processing a read or a write? IOW how do I know if GetQueuedCompletionStatus was unblocked for a pending WSARecv or WSASend?

thanks.


---jt