From 89ee081584efbd215ad7780ee6500c387d776845 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sun, 17 Mar 2024 19:31:33 +0100 Subject: io, io_codec: Minor work on io code --- modules/io/examples/echo_client.cpp | 4 ++++ modules/io_codec/c++/io_peer.hpp | 7 ++++--- modules/io_codec/c++/io_peer.tmpl.hpp | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/io/examples/echo_client.cpp b/modules/io/examples/echo_client.cpp index fa9781d..53ebe54 100644 --- a/modules/io/examples/echo_client.cpp +++ b/modules/io/examples/echo_client.cpp @@ -50,6 +50,10 @@ int main(){ keep_running = false; }).detach(); + + async_rmt->on_read_disconnected().then([&](){ + keep_running = false; + }).detach(); }).detach(); }).detach(); diff --git a/modules/io_codec/c++/io_peer.hpp b/modules/io_codec/c++/io_peer.hpp index 9ba623f..a92e236 100644 --- a/modules/io_codec/c++/io_peer.hpp +++ b/modules/io_codec/c++/io_peer.hpp @@ -14,13 +14,14 @@ template >> feed, own stream, Codec codec, BufferT in, BufferT out); + /** - * + * Constructor */ streaming_io_peer( own>> feed, @@ -35,7 +36,7 @@ public: /** * Send a message to the remote peer */ - error send(heap_message_root builder); + error_or send(heap_message_root builder); /** * A phantom conveyor feeder. Meant for interfacing with other components diff --git a/modules/io_codec/c++/io_peer.tmpl.hpp b/modules/io_codec/c++/io_peer.tmpl.hpp index 880a58a..342ca42 100644 --- a/modules/io_codec/c++/io_peer.tmpl.hpp +++ b/modules/io_codec/c++/io_peer.tmpl.hpp @@ -72,7 +72,7 @@ streaming_io_peer -error streaming_io_peer streaming_io_peer::send(heap_message_root msg) { bool restart_write = out_buffer_.read_segment_length() == 0; -- cgit v1.2.3