Public Member Functions | |
CIOCompletionPort (DWORD maxConcurrency) | |
Creates an I/O completion port with the specified maximum number of threads that the operating system can allow to concurrently process I/O completion packets for the I/O completion port. | |
CIOCompletionPort (const CIOCompletionPort &rhs) | |
CIOCompletionPort & | operator= (const CIOCompletionPort &rhs) |
void | AssociateDevice (HANDLE hDevice, ULONG_PTR completionKey) const |
Associate a device, represented by the supplied HANDLE, and the supplied completion key with the I/O completion port. Overlapped I/O that occurs on device will then post completion packets to the port. | |
bool | TryAssociateDevice (HANDLE hDevice, ULONG_PTR completionKey) const |
Attempt to associate a device, represented by the supplied HANDLE, and the supplied completion key with the I/O completion port. Overlapped I/O that occurs on device will then post completion packets to the port. Returns false, rather than throwing an exception, when an error occurs, you can call GetLastError() to retrieve the error message;. | |
void | PostStatus (ULONG_PTR completionKey, DWORD dwNumBytes=0, OVERLAPPED *pOverlapped=nullptr) |
Manually post a completion packet to the I/O completion port. | |
void | GetStatus (ULONG_PTR *pCompletionKey, PDWORD pdwNumBytes, OVERLAPPED **ppOverlapped) |
Waits, indefinitely, for a completion packet to arrive at the port. Throws an exception on failure. | |
bool | GetStatus (ULONG_PTR *pCompletionKey, PDWORD pdwNumBytes, OVERLAPPED **ppOverlapped, Milliseconds timeout) |
Waits, with a timeout, for a completion packet to arrive at the port. Throws an exception on failure. | |
bool | GetStatus (ULONG_PTR *pCompletionKey, PDWORD pdwNumBytes, OVERLAPPED **ppOverlapped, DWORD *pLastError) |
Waits, indefinitely, for a completion packet to arrive at the port but returns false and the value of the last error if an error occurs. | |
bool | GetStatus (ULONG_PTR *pCompletionKey, PDWORD pdwNumBytes, OVERLAPPED **ppOverlapped, DWORD &lastError, Milliseconds timeout) |
Waits, with a timeout, for a completion packet to arrive at the port and returns false and the value of the last error if an error occurs. | |
void | GetStatus (OVERLAPPED_ENTRY *pEntries, ULONG &numEntries) |
Waits, indefinitely, for completion packets to arrive at the port. Throws an exception on failure. | |
bool | GetStatus (OVERLAPPED_ENTRY *pEntries, ULONG &numEntries, Milliseconds timeout) |
Waits, with a timeout, for completion packets to arrive at the port. Throws an exception on failure. | |
bool | GetStatus (OVERLAPPED_ENTRY *pEntries, ULONG &numEntries, DWORD *pLastError) |
Waits, indefinitely, for completion packets to arrive at the port but returns false and the value of the last error if an error occurs. | |
bool | GetStatus (OVERLAPPED_ENTRY *pEntries, ULONG &numEntries, DWORD &lastError, Milliseconds timeout) |
Waits, with a timeout, for completion packets to arrive at the port and returns false and the value of the last error if an error occurs. | |
HANDLE | GetHandle () const |
Obtains the handle to the underlying IOCP, use with care!!! We only need to expose this because the SetInformationJobObject function needs it... |
CIOCompletionPort | ( | DWORD | maxConcurrency | ) | [explicit] |
Creates an I/O completion port with the specified maximum number of threads that the operating system can allow to concurrently process I/O completion packets for the I/O completion port.
CIOCompletionPort | ( | const CIOCompletionPort & | rhs | ) |
CIOCompletionPort& operator= | ( | const CIOCompletionPort & | rhs | ) |
Associate a device, represented by the supplied HANDLE, and the supplied completion key with the I/O completion port. Overlapped I/O that occurs on device will then post completion packets to the port.
Attempt to associate a device, represented by the supplied HANDLE, and the supplied completion key with the I/O completion port. Overlapped I/O that occurs on device will then post completion packets to the port. Returns false, rather than throwing an exception, when an error occurs, you can call GetLastError() to retrieve the error message;.
void PostStatus | ( | ULONG_PTR | completionKey, | |
DWORD | dwNumBytes = 0 , |
|||
OVERLAPPED * | pOverlapped = nullptr | |||
) |
Manually post a completion packet to the I/O completion port.
void GetStatus | ( | ULONG_PTR * | pCompletionKey, | |
PDWORD | pdwNumBytes, | |||
OVERLAPPED ** | ppOverlapped | |||
) |
Waits, indefinitely, for a completion packet to arrive at the port. Throws an exception on failure.
bool GetStatus | ( | ULONG_PTR * | pCompletionKey, | |
PDWORD | pdwNumBytes, | |||
OVERLAPPED ** | ppOverlapped, | |||
Milliseconds | timeout | |||
) |
Waits, with a timeout, for a completion packet to arrive at the port. Throws an exception on failure.
bool GetStatus | ( | ULONG_PTR * | pCompletionKey, | |
PDWORD | pdwNumBytes, | |||
OVERLAPPED ** | ppOverlapped, | |||
DWORD * | pLastError | |||
) |
Waits, indefinitely, for a completion packet to arrive at the port but returns false and the value of the last error if an error occurs.
bool GetStatus | ( | ULONG_PTR * | pCompletionKey, | |
PDWORD | pdwNumBytes, | |||
OVERLAPPED ** | ppOverlapped, | |||
DWORD & | lastError, | |||
Milliseconds | timeout | |||
) |
Waits, with a timeout, for a completion packet to arrive at the port and returns false and the value of the last error if an error occurs.
void GetStatus | ( | OVERLAPPED_ENTRY * | pEntries, | |
ULONG & | numEntries | |||
) |
Waits, indefinitely, for completion packets to arrive at the port. Throws an exception on failure.
bool GetStatus | ( | OVERLAPPED_ENTRY * | pEntries, | |
ULONG & | numEntries, | |||
Milliseconds | timeout | |||
) |
Waits, with a timeout, for completion packets to arrive at the port. Throws an exception on failure.
bool GetStatus | ( | OVERLAPPED_ENTRY * | pEntries, | |
ULONG & | numEntries, | |||
DWORD * | pLastError | |||
) |
Waits, indefinitely, for completion packets to arrive at the port but returns false and the value of the last error if an error occurs.
bool GetStatus | ( | OVERLAPPED_ENTRY * | pEntries, | |
ULONG & | numEntries, | |||
DWORD & | lastError, | |||
Milliseconds | timeout | |||
) |
Waits, with a timeout, for completion packets to arrive at the port and returns false and the value of the last error if an error occurs.
HANDLE GetHandle | ( | ) | const |
Obtains the handle to the underlying IOCP, use with care!!! We only need to expose this because the SetInformationJobObject function needs it...