// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "hordecomputebuffer.h" namespace zen::horde { /** Bidirectional communication channel using a pair of compute buffers. * * Pairs a ComputeBufferReader (for receiving data) with a ComputeBufferWriter * (for sending data). Used by ComputeSocket to represent one logical channel * within a multiplexed connection. */ class ComputeChannel : public TRefCounted { public: ComputeBufferReader Reader; ComputeBufferWriter Writer; ComputeChannel(ComputeBufferReader InReader, ComputeBufferWriter InWriter); bool IsValid() const; size_t Send(const void* Data, size_t Size, int TimeoutMs = -1); size_t Recv(void* Data, size_t Size, int TimeoutMs = -1); /** Signal that no more data will be sent on this channel. */ void MarkComplete(); }; } // namespace zen::horde