1. Creation completion port;
2. Create a socket. If it is a client, directly associate it with the socket. If it is a server, use the socket returned by accept to associate it .. Specify the completion key. It is best to include the associated file pointer, which is the socket pointer here ..
3. In the Recv and send functions, a custom interface starting with overlapped can be filled with Recv and send when the completion port is complete ..
4. There is a device list associated with each completion port. Its records include the completion key and overlapped struct... In this way, you can obtain the corresponding file handle through the file handle contained in the completion key. At the same time, the custom struct starting with the overlapped struct can append some relevant information ..
5. These items can be obtained by getqueuedcompletionstatus ..