"Un-associate" socket from completion port

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?

+2
source share
2 answers

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().

The documentation for CreateIoCompletionPort contains notes on resource handling:

, FileHandle, , -. , CreateFile FILE_FLAG_OVERLAPPED (, , , ). , , , /. AcceptEx. -, , , -, .

...

- , -, -. - , . , / . -, CloseHandle.

+5

Microsoft, , , , , , ( , ):

NtSetInformationFile, FileReplaceCompletionInformation FileInformationClass, . ( FILE_INFORMATION_CLASS)

( ):

- . FILE_COMPLETION_INFORMATION . -NULL, - . -, file handle, NULL. , CreateIoCompletionPort.

+3

All Articles