[+] ENetworkError::eBrokenByteBuffer

This commit is contained in:
Reece Wilson 2023-10-23 11:18:07 +01:00
parent 72fd8d018e
commit 08c37454fe
3 changed files with 16 additions and 0 deletions

View File

@ -33,6 +33,7 @@ namespace Aurora::IO::Net
eServiceRefused, eServiceRefused,
eServiceTaken, eServiceTaken,
eBrokenAIOPipe, eBrokenAIOPipe,
eBrokenByteBuffer
eUnknown eUnknown
)); ));
} }

View File

@ -126,6 +126,14 @@ namespace Aurora::IO::Net
void SocketChannelInput::OnPipePartialEvent(AuUInt transferred) void SocketChannelInput::OnPipePartialEvent(AuUInt transferred)
{ {
// Other method is used // Other method is used
if (auto pBuffer = this->AsReadableByteBuffer())
{
if (pBuffer->HasStreamError())
{
this->pParent_->SendErrorBeginShutdown(AuNet::ENetworkError::eBrokenByteBuffer);
}
}
} }
void SocketChannelInput::OnPipeReallocEvent(bool bSuccess) void SocketChannelInput::OnPipeReallocEvent(bool bSuccess)

View File

@ -237,6 +237,13 @@ namespace Aurora::IO::Net
else else
{ {
this->pNetWriteTransaction_->SetCallback({}); this->pNetWriteTransaction_->SetCallback({});
if (this->outputBuffer_.HasStreamError())
{
this->pParent_->SendErrorBeginShutdown(AuNet::ENetworkError::eBrokenByteBuffer);
return true;
}
if (this->bShutdownOnComplete) if (this->bShutdownOnComplete)
{ {
return true; return true;