/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: AuNetStream.Linux.hpp Date: 2022-8-26 Author: Reece ***/ #pragma once #include #include #include #include #include #include namespace Aurora::IO::Net { struct SocketBase; struct LinuxAsyncNetworkTransaction : IAsyncTransaction, AuEnableSharedFromThis, Aurora::IO::UNIX::ASubmittable { LinuxAsyncNetworkTransaction(SocketBase *pSocket); ~LinuxAsyncNetworkTransaction(); bool StartRead(AuUInt64 offset, const AuSPtr &memoryView) override; bool StartWrite(AuUInt64 offset, const AuSPtr &memoryView) override; bool Complete() override; bool CompleteEx(AuUInt completeRoutine); bool Failed() override; AuUInt GetOSErrorCode() override; AuUInt32 GetLastPacketLength() override; void SetCallback(const AuSPtr &sub) override; bool Wait(AuUInt32 timeout) override; AuSPtr NewLoopSource() override; void Reset() override; virtual void LIOS_Process(AuUInt32 read, bool failure, int err, bool mark) override; void MakeSyncable(); void ForceNextWriteWait(); bool IDontWannaUsePorts(); void DispatchCb(AuUInt32 len); int GetSocket(); int GetAlertable(); bool TranslateLastError(bool bReturnValue); SocketBase * pSocket; 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; }; }