mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-09-24 00:40:18 +08:00
Update release package imports
This commit is contained in:
@@ -3807,7 +3807,15 @@ RESTART_LOOP:
|
||||
}
|
||||
|
||||
DWORD error = GetLastError();
|
||||
if (error == ERROR_BROKEN_PIPE || error == ERROR_INVALID_HANDLE)
|
||||
if (error == ERROR_BROKEN_PIPE || error == ERROR_NO_DATA)
|
||||
{
|
||||
if (!stopped)
|
||||
{
|
||||
OnDisconnected();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (error == ERROR_INVALID_HANDLE)
|
||||
{
|
||||
if (!stopped)
|
||||
{
|
||||
@@ -3866,7 +3874,16 @@ RESTART_LOOP:
|
||||
else
|
||||
{
|
||||
DWORD error = GetLastError();
|
||||
if (error == ERROR_OPERATION_ABORTED || error == ERROR_INVALID_HANDLE || error == ERROR_BROKEN_PIPE || error == ERROR_NO_DATA)
|
||||
if (error == ERROR_BROKEN_PIPE || error == ERROR_NO_DATA)
|
||||
{
|
||||
if (!self->stopped)
|
||||
{
|
||||
self->OnDisconnected();
|
||||
}
|
||||
finalize();
|
||||
return;
|
||||
}
|
||||
if (error == ERROR_OPERATION_ABORTED || error == ERROR_INVALID_HANDLE)
|
||||
{
|
||||
if (!self->stopped)
|
||||
{
|
||||
@@ -4061,6 +4078,14 @@ void NamedPipeConnection::InstallCallback(INetworkProtocolCallback* _callback)
|
||||
void NamedPipeConnection::Stop()
|
||||
{
|
||||
stopped = 1;
|
||||
SPIN_LOCK(lockWrite)
|
||||
{
|
||||
if (hPipe != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
CancelIoEx(hPipe, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
ReadWaitContext* context = readWaitContext.exchange(nullptr);
|
||||
if (context)
|
||||
{
|
||||
@@ -4081,7 +4106,6 @@ void NamedPipeConnection::Stop()
|
||||
{
|
||||
if (hPipe != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
CancelIoEx(hPipe, NULL);
|
||||
CloseHandle(hPipe);
|
||||
hPipe = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user