Socket funcions and IOCompletion port questions?
-
1. Does AcceptEx and ConnnectEx support IOCP? 2. Mswsock.h doesn't have a declare of ConnectEx, how can I use it? 3. If A sends a packet to B, then B receives it use in an IOCP method, but how does B know when to call WSAReceive? DO I have to use WSAAsyncSelect/WSAEventSelect at the same time?
-
1. Does AcceptEx and ConnnectEx support IOCP? 2. Mswsock.h doesn't have a declare of ConnectEx, how can I use it? 3. If A sends a packet to B, then B receives it use in an IOCP method, but how does B know when to call WSAReceive? DO I have to use WSAAsyncSelect/WSAEventSelect at the same time?
Hi, 1. Yes, and yes. 2. U should be using winsock2.h 3. IOCP sockets that support 'receiving data', should be in a constant state of 'being ready to receive data. Due to the nature of IOCP, the worker threads are the ones handling the events, so you don't want to use WASAsyncSelect/WSAEventSelect stuff. There are a couple of really good articles on CP for IOCP servers and sockets - you should have a look at them. Also, remember that if you have multiple buffers per socket (which you should have), you will not always be able to guarantee the sequence of partial packets received when you run on a multi-CPU box. Hope this helps a bit
controlSHIFT [WinShareSpy] [Glossary Manager] [AfterThought Backup Lite] All good things were meant to be improved