AuroraRuntime/Source/IO/Net/AuNetSocketChannelOutput.hpp
Reece Wilson 267c2216b0 [+] UDP over socket API via existing INetSrvDatagram layer
(...missing send)
[+] AuIO::Buffer::ViewReader
[+] AuIO::Buffer::ViewSeekableReadable
[+] AuIO::Buffer::ViewWriter
[*] Clean up AuCompression
[*[ AuLog messages must always crunch for memory
[*] Various bug fixes
[*] Refactor+clean up
2022-12-12 23:50:05 +00:00

49 lines
1.3 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuNetSocketChannelOutput.hpp
Date: 2022-8-32
Author: Reece
***/
#pragma once
#include "AuNetWriteQueue.hpp"
namespace Aurora::IO::Net
{
struct SocketBase;
struct NtAsyncNetworkTransaction;
struct SocketChannelOutput : IAsyncFinishedSubscriber
{
SocketChannelOutput(SocketBase *pParent, const AuSPtr<IAsyncTransaction> &stream);
bool IsValid();
AuSPtr<IAsyncTransaction> ToWriteTransaction();
AuSPtr<Memory::ByteBuffer> AsWritableByteBuffer();
void ScheduleOutOfFrameWrite();
// Write outbound shit
void SchedWriteTick();
void SendIfData();
bool WriteTickLocked();
void WriteTick();
void OnEndOfReadTick();
void OnAsyncFileOpFinished(AuUInt64 offset, AuUInt32 length) override;
bool bShutdownOnComplete {};
AuByteBuffer &GetByteBuffer();
bool CanResize();
private:
SocketBase * pParent_;
AuSPtr<IAsyncTransaction> pNetWriteTransaction_;
void * pOutSendPointer_ {};
AuByteBuffer outputBuffer_;
NetWriteQueue outputWriteQueue_;
AuThreadPrimitives::SpinLock lock_;
};
}