CreateIoCompletionPort()Used to bind a socket to a termination port. However, when this socket is closed, I need to "disconnect" it from the termination port. How can i do this?
CreateIoCompletionPort()
The handle associated with the I / O completion port is removed from the port when the handle is closed. In the case of a network socket, the handle closes by calling closesocket().
closesocket()
The documentation for CreateIoCompletionPort contains notes on resource handling:
, FileHandle, , -. , CreateFile FILE_FLAG_OVERLAPPED (, , , ). , , , /. AcceptEx. -, , , -, ....- , -, -. - , . , / . -, CloseHandle.
, FileHandle, , -. , CreateFile FILE_FLAG_OVERLAPPED (, , , ). , , , /. AcceptEx. -, , , -, .
...
- , -, -. - , . , / . -, CloseHandle.
Microsoft, , , , , , ( , ):
NtSetInformationFile, FileReplaceCompletionInformation FileInformationClass, . ( FILE_INFORMATION_CLASS)
NtSetInformationFile
FileReplaceCompletionInformation
FileInformationClass
FILE_INFORMATION_CLASS
( ):
- . FILE_COMPLETION_INFORMATION . -NULL, - . -, file handle, NULL. , CreateIoCompletionPort.