Dennis Mikhailitsky
2008-06-21 14:05:16 UTC
Hello,
I use IOCP for a socket server. When a new connection is created, the
connection's session is created in memory dynamically and its address
is passed to CreateIoCompletionPort as the completion key when the
connection's socket is associated with a completion port. My question
is - when it is 100% safe to remove the connection's session (address
of which GetQueuedCompletionStatus returns as the completion key when
an operation on the socket completes) from memory? In other words,
what combination of both the return value and the output parameters of
GetQueuedCompletionStatus is a 100% indication of that
GetQueuedCompletionStatus will never return this same completion key
again?
Thanks in advance
I use IOCP for a socket server. When a new connection is created, the
connection's session is created in memory dynamically and its address
is passed to CreateIoCompletionPort as the completion key when the
connection's socket is associated with a completion port. My question
is - when it is 100% safe to remove the connection's session (address
of which GetQueuedCompletionStatus returns as the completion key when
an operation on the socket completes) from memory? In other words,
what combination of both the return value and the output parameters of
GetQueuedCompletionStatus is a 100% indication of that
GetQueuedCompletionStatus will never return this same completion key
again?
Thanks in advance