#pragma once #include "async.h" #include "message.h" #include "io.h" namespace saw { template , typename OutContainer = MessageContainer, typename BufferT = RingBuffer> class StreamingIoPeer { private: Own>> incoming_feeder = nullptr; Own io_stream; Codec codec; BufferT in_buffer; BufferT out_buffer; SinkConveyor sink_read; SinkConveyor sink_write; public: StreamingIoPeer(Own>> feed, Own stream, Codec codec, BufferT in, BufferT out); StreamingIoPeer(Own>> feed, Own stream); void send(HeapMessageRoot builder); Conveyor onReadDisconnected(); }; /** * Setup new streaming io peer with the provided network protocols. * This is a convenience wrapper intended for a faster setup of */ template , typename OutContainer = MessageContainer, typename BufferT = RingBuffer> std::pair, Conveyor>> newStreamingIoPeer(Own stream); } // namespace saw #include "io_peer.tmpl.h"