Re: IOCP with WinSock 2
- From: "Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx>
- Date: Wed, 29 Aug 2007 13:38:28 +0300
You have to read/( possible write) in work thread due to IOCP's
when GetQueuedCompletionStatus() awake the thread, not v.v
Check IOCP example on PSDK
Arkady
"solobo" <solobo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2E88936E-E4F2-4D33-8AA2-B363CC4D135D@xxxxxxxxxxxxxxxx
Hi all,
I am totally confused, and hope some one can clarify this for me.
I am writing a WinSock 2 app (server and client), using IOCP.
Each app call WSARecv() of WSASend() on the same socket handle, depending
on
the state.
I create a single thread for Read/Wrie.
I call CreateIoCompletionPort() with NULL's ---> That works OK.
I call CreateIoCompletionPort() with Completion Port Handle, Socket
Handle,
and a completion Key. ---> That works OK.
I call GetQueuedCompletionStatus() on WSARecv() and it bloked the first
time
and returned only when data was received.
I call GetQueuedCompletionStatus() on WSASend()
However, the blocking stopped woking on subsequent calls to
GetQueuedCompletionStatus() on WSARecv() , and the number of bytes
received
is always the same as the number of bytes on the last WSASend(), even
though
no data was sent.
Here are my questions:
Should I create a different thread for WSARecv() and WSASend()?
If so, how do I account for the fact that the same socket handle is used
for
both routeins?
I would greatly appreciate it if some one can show me what I am missing.
.
- Prev by Date: Re: network + subnet address
- Next by Date: Re: network + subnet address
- Previous by thread: Re: SSL TLS Compression support
- Next by thread: wininet and ftp
- Index(es):
Relevant Pages
|
|