[*] Resolve one stated Windows 7 defect
This commit is contained in:
parent
5dddc9d0d8
commit
c084f18c62
@ -2,6 +2,4 @@
|
||||
|
||||
2 - soft defect; emuation performance) The time to wake metric across AuThreading::[Wake/Wait]OnAddress starts off at 1.5 - 2.2x modern Windows with RtlWaitOnAddress; although, the best case of basic primitives will still be faster than SRW Locks of Windows 7 through 11. Era correct internal NT apis are used across XP - Windows 11 targets. Note, WaitOnAddress emulation is not required for basic thread primitives; such scheduler indirection would only hurt performance. Performance should otherwise be exactly what you would expect once you remove Microsofts regressing CRT and lackluster stock thread primitives from the equation.
|
||||
|
||||
3) DNS look ups, when using the systems interface, will block the users thread as opposed to being an overlapped operation. Most application vendors would want to run their IO, especially network io, on a seperate thread from UI. This shouldn't be much of an issue for Windows 7 clients, I suppose.
|
||||
|
||||
4 - soft defect; workaround available) Stock Windows 7 console host is infamously bad. ConsoleTTY can in theory continue to work down to targets as old as Windows XP without the use of third party software; however, it should be noted TrueType fonts tend to cause hideous positioning faults when used with Aurora::Console::ConsoleTTY::GetTTYConsole()->Start(). Raster fonts tend to have better compatibility on older Windows operating systems. Aurora::Console::ConsoleTTY::* and Aurora::Console::ConsoleSTD::* (noncanonical apis) remain available and fully functional under Windows 7.
|
||||
3 - soft defect; workaround available) Stock Windows 7 console host is infamously bad. ConsoleTTY can in theory continue to work down to targets as old as Windows XP without the use of third party software; however, it should be noted TrueType fonts tend to cause hideous positioning faults when used with Aurora::Console::ConsoleTTY::GetTTYConsole()->Start(). Raster fonts tend to have better compatibility on older Windows operating systems. Aurora::Console::ConsoleTTY::* and Aurora::Console::ConsoleSTD::* (noncanonical apis) remain available and fully functional under Windows 7.
|
@ -34,6 +34,11 @@ namespace Aurora::IO::Net
|
||||
ADDRINFOEXW infoEx {};
|
||||
int iInfoEx { 0 };
|
||||
|
||||
if (!this->pEvent)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this->bA && this->bAAAA)
|
||||
{
|
||||
infoEx.ai_family = AF_UNSPEC;
|
||||
@ -73,25 +78,58 @@ namespace Aurora::IO::Net
|
||||
}
|
||||
else
|
||||
{
|
||||
iRet = pGetAddrInfoExW(AuLocale::ConvertFromUTF8(this->hostname).data(),
|
||||
auto pShared = this->SharedFromThis();
|
||||
|
||||
auto pThread = AuThreads::ThreadUnique(AuThreads::ThreadInfo(
|
||||
AuMakeShared<AuThreads::IThreadVectorsFunctional>(AuThreads::IThreadVectorsFunctional::OnEntry_t(std::bind([=]()
|
||||
{
|
||||
int iRet {};
|
||||
if ((iRet = pGetAddrInfoExW(AuLocale::ConvertFromUTF8(pShared->hostname).data(),
|
||||
nullptr,
|
||||
NS_DNS,
|
||||
nullptr,
|
||||
&infoEx,
|
||||
&this->resultHandle_,
|
||||
&pShared->resultHandle_,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr);
|
||||
nullptr)) != ERROR_SUCCESS)
|
||||
{
|
||||
pShared->bForceError_ = true;
|
||||
pShared->uOsError = iRet;
|
||||
pShared->error_ = pShared->ToError();
|
||||
}
|
||||
|
||||
pShared->pEvent->Set();
|
||||
})),
|
||||
AuThreads::IThreadVectorsFunctional::OnExit_t{}),
|
||||
"Legacy Win32 DNS Request"
|
||||
));
|
||||
|
||||
if (!pThread)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
pThread->Run();
|
||||
pThread->Detach();
|
||||
|
||||
iRet = ERROR_IO_PENDING;
|
||||
}
|
||||
}
|
||||
else if (pgetaddrinfo)
|
||||
{
|
||||
auto pShared = this->SharedFromThis();
|
||||
|
||||
auto pThread = AuThreads::ThreadUnique(AuThreads::ThreadInfo(
|
||||
AuMakeShared<AuThreads::IThreadVectorsFunctional>(AuThreads::IThreadVectorsFunctional::OnEntry_t(std::bind([=]()
|
||||
{
|
||||
int iRet {};
|
||||
ADDRINFOA infoA { 0 };
|
||||
PADDRINFOA pInfoRet {};
|
||||
infoA.ai_family = infoEx.ai_family;
|
||||
|
||||
iRet = pgetaddrinfo(this->hostname.c_str(),
|
||||
iRet = pgetaddrinfo(pShared->hostname.c_str(),
|
||||
nullptr,
|
||||
&infoA,
|
||||
&pInfoRet);
|
||||
@ -106,26 +144,48 @@ namespace Aurora::IO::Net
|
||||
AuMemcpy(endpoint.hint, pCurrent->ai_addr, pCurrent->ai_addrlen);
|
||||
DeoptimizeEndpoint(endpoint);
|
||||
|
||||
if (!AuTryInsert(this->processedIps_, endpoint.ip))
|
||||
if (!AuTryInsert(pShared->processedIps_, endpoint.ip))
|
||||
{
|
||||
return false;
|
||||
pShared->bForceError_ = true;
|
||||
break;
|
||||
}
|
||||
|
||||
pCurrent = pCurrent->ai_next;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pShared->bForceError_ = true;
|
||||
pShared->uOsError = iRet;
|
||||
pShared->error_ = pShared->ToError();
|
||||
}
|
||||
|
||||
if (pInfoRet && pfreeaddrinfo)
|
||||
{
|
||||
pfreeaddrinfo(pInfoRet);
|
||||
}
|
||||
|
||||
pShared->pEvent->Set();
|
||||
})),
|
||||
AuThreads::IThreadVectorsFunctional::OnExit_t{}),
|
||||
"Legacy Win32 DNS Request"
|
||||
));
|
||||
|
||||
if (!pThread)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
pThread->Run();
|
||||
pThread->Detach();
|
||||
|
||||
iRet = ERROR_IO_PENDING;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
this->hName_ = hHandle;
|
||||
return this->FinishOperationEx(AuSharedFromThis(),
|
||||
this->pWorker_,
|
||||
@ -164,8 +224,11 @@ namespace Aurora::IO::Net
|
||||
if (this->pCompletion_)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this->error_.netError == ENetworkError::eEnumInvalid)
|
||||
{
|
||||
this->error_ = ENetworkError::eAsyncError;
|
||||
}
|
||||
this->pCompletion_->OnFailure((void *)&this->error_);
|
||||
}
|
||||
catch (...)
|
||||
@ -224,6 +287,11 @@ namespace Aurora::IO::Net
|
||||
{
|
||||
auto pCurrent = this->resultHandle_;
|
||||
|
||||
if (this->bForceError_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
while (pCurrent)
|
||||
{
|
||||
NetEndpoint endpoint;
|
||||
|
@ -46,6 +46,7 @@ namespace Aurora::IO::Net
|
||||
AuList<IPAddress> processedIps_;
|
||||
AuSPtr<AuAsync::PromiseCallback<AuList<IPAddress>, NetError>> pCompletion_;
|
||||
bool bHasCompleted_ {};
|
||||
bool bForceError_ {};
|
||||
PADDRINFOEXW resultHandle_ {};
|
||||
NetError error_;
|
||||
HANDLE hName_ { NULL };
|
||||
|
Loading…
Reference in New Issue
Block a user