aboutsummaryrefslogtreecommitdiff
path: root/src/zenhorde/hordecomputechannel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenhorde/hordecomputechannel.h')
-rw-r--r--src/zenhorde/hordecomputechannel.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/zenhorde/hordecomputechannel.h b/src/zenhorde/hordecomputechannel.h
new file mode 100644
index 000000000..c1dff20e4
--- /dev/null
+++ b/src/zenhorde/hordecomputechannel.h
@@ -0,0 +1,32 @@
+// 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<ComputeChannel>
+{
+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