/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: AuNetStream.NT.hpp Date: 2022-8-17 Author: Reece ***/ #pragma once #include #include #include #include namespace Aurora::IO::Net { struct SocketBase; struct NtAsyncNetworkTransaction : IAsyncTransaction, AuEnableSharedFromThis { NtAsyncNetworkTransaction(SocketBase *pSocket); ~NtAsyncNetworkTransaction(); bool StartRead(AuUInt64 offset, const AuSPtr &memoryView) override; bool StartWrite(AuUInt64 offset, const AuSPtr &memoryView) override; bool Complete() override; bool CompleteEx(AuUInt completeRoutine, bool bForce = false); bool Failed() override; bool HasErrorCode(); AuUInt GetOSErrorCode() override; AuUInt32 GetLastPacketLength() override; void SetCallback(const AuSPtr &sub) override; bool Wait(AuUInt32 timeout) override; AuSPtr NewLoopSource() override; void Reset(); void MakeSyncable(); void ForceNextWriteWait(); bool IDontWannaUsePorts(); void DispatchCb(AuUInt32 len); SOCKET GetSocket(); HANDLE GetAlertable(); bool TranslateLastError(bool bReturnValue); SocketBase * pSocket; OVERLAPPED overlap {}; AuSPtr pWaitable; bool bForceNextWait {}; AuSPtr pPin; AuUInt32 dwLastAbstractStat {}, dwLastAbstractOffset {}, dwLastBytes {}; bool bIsIrredeemable {}; bool bLatch {}; AuUInt32 dwOsErrorCode {}; AuUInt32 dwRecvFlags {}; AuUInt32 dwSendFlags {}; bool bHasFailed {}; AuSPtr pMemoryHold; bool bDisallowRecv {}; bool bDisallowSend {}; bool bSendEOSOnce {}; bool bIsWriting {}; bool bDatagramMode {}; AuSPtr pSub; int iSocketLength {}; NetEndpoint netEndpoint; }; }