private unsafe void CompletionPortCallback(uint errorCode, uint numBytes, NativeOverlapped* nativeOverlapped)
{
if (errorCode == Interop.HttpApi.ERROR_SUCCESS ||
errorCode == Interop.HttpApi.ERROR_HANDLE_EOF)
{
FinishOperationSuccess((int)numBytes, false);
}
else
{
FinishOperationFailure(new HttpListenerException((int)errorCode), false);
}
}