IOCP goes wrong?
-
I am writting a C/S program based by Socket and IO completion. I use CreateIoCompletionPort and GetQueuedCompletionStatus to build and get the connected socket. The Server program goes well when it is built. I also built a client for testing server.But a problem comes. If I use one client to connect the server, everything is fine. IF I use two more client to connect the server at the same time, the server handle them one by one.It doesn't handle them synchronously as I expected. Does anyone know the reason. Anyone is so kind to replay me? Thanks. aaa
-
I am writting a C/S program based by Socket and IO completion. I use CreateIoCompletionPort and GetQueuedCompletionStatus to build and get the connected socket. The Server program goes well when it is built. I also built a client for testing server.But a problem comes. If I use one client to connect the server, everything is fine. IF I use two more client to connect the server at the same time, the server handle them one by one.It doesn't handle them synchronously as I expected. Does anyone know the reason. Anyone is so kind to replay me? Thanks. aaa
u gave the answer in ur question!! read it carefully U will get the key!! The chosen One :)
-
u gave the answer in ur question!! read it carefully U will get the key!! The chosen One :)
Really? Sorry, i have tried a lot. But it isn't improved. I am locked by the it. Can u tell the detail of the key ?
-
I am writting a C/S program based by Socket and IO completion. I use CreateIoCompletionPort and GetQueuedCompletionStatus to build and get the connected socket. The Server program goes well when it is built. I also built a client for testing server.But a problem comes. If I use one client to connect the server, everything is fine. IF I use two more client to connect the server at the same time, the server handle them one by one.It doesn't handle them synchronously as I expected. Does anyone know the reason. Anyone is so kind to replay me? Thanks. aaa
hmm, unless you have 2+ CPU box, it will handle them always synchronously. IOCP only can help somehow masquerade it. :) Checklist for the very beginning - are your sockets initialized as
OVERLAPPED
? - are there more threads waiting inGetQueuetCompletionStatus
? - what about the return codes fromWSASend/FileWrite
, are they correct? - is the problem while accepting the clients, or while communicating?