What is the advantage of using IOCP? First it is a method of using a thread pool. When you create an IOCP, you have to set up how much concurrent threads. When you create an IOCP in calling the CreateiocompletionPort function, you will set how much threads are executed. If the NumberOfConcurrentThreads parameter is set to 0, it is the same number of threads to the CPU. This uses the thread pool to create any new thread when you receive any new threads, providing a higher response speed.
Second, IOCP is the call mechanism of the kernel. Its priority is relatively high, and if you are not careful when debugging, it is easy to crash. I will crash when I have a length of 0 in the write-wrong receiving data buffer.
So far, I have made me this IOCP to run, and can receive data and send data.
If you don't want to know the specific work process, you can directly use the ACE's encapsulated classes to OK. IOCP in ACE is packaged in the ACE_WIN32_WAKEUP_COMPLETION class, which fully implements all IOCP functions. Want to develop high-performance servers, or use ACE to be more convenient, fast, so I don't have to go deep into the IOCP package.