From 4b79aa902b8c9bb8fe7d34732fd545435a4332a1 Mon Sep 17 00:00:00 2001 From: Reece Date: Wed, 26 Apr 2023 20:22:11 +0100 Subject: [PATCH] [*] i dont think this path should ever be hit, but just to be certain, lets check the networks output channel translation object for an error if the socketbase doesnt know of the last fatal error code --- Source/IO/Net/AuNetSocket.cpp | 5 +++++ Source/IO/Net/AuNetSocketChannelOutput.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/Source/IO/Net/AuNetSocket.cpp b/Source/IO/Net/AuNetSocket.cpp index fd5c394c..a537a5a3 100644 --- a/Source/IO/Net/AuNetSocket.cpp +++ b/Source/IO/Net/AuNetSocket.cpp @@ -456,6 +456,11 @@ namespace Aurora::IO::Net { NetError_SetOsError(this->error_, this->socketChannel_.inputChannel.pNetReadTransaction->GetOSErrorCode()); } + else if (this->socketChannel_.outputChannel.pNetWriteTransaction_ && + this->socketChannel_.outputChannel.pNetWriteTransaction_->Failed()) + { + NetError_SetOsError(this->error_, this->socketChannel_.outputChannel.pNetWriteTransaction_->GetOSErrorCode()); + } } return this->error_; diff --git a/Source/IO/Net/AuNetSocketChannelOutput.hpp b/Source/IO/Net/AuNetSocketChannelOutput.hpp index ff754b86..f684478f 100644 --- a/Source/IO/Net/AuNetSocketChannelOutput.hpp +++ b/Source/IO/Net/AuNetSocketChannelOutput.hpp @@ -39,6 +39,7 @@ namespace Aurora::IO::Net bool CanResize(); private: + friend struct SocketBase; SocketBase * pParent_; AuSPtr pNetWriteTransaction_; void * pOutSendPointer_ {};