From a64b8346f39a34ef811b679bbed8131e2098e546 Mon Sep 17 00:00:00 2001 From: Claudius 'keldu' Holeksa Date: Thu, 8 Aug 2024 18:13:31 +0200 Subject: wip --- modules/io_codec/examples/peer_echo_server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/io_codec/examples/peer_echo_server.cpp') diff --git a/modules/io_codec/examples/peer_echo_server.cpp b/modules/io_codec/examples/peer_echo_server.cpp index 02a7272..87bf721 100644 --- a/modules/io_codec/examples/peer_echo_server.cpp +++ b/modules/io_codec/examples/peer_echo_server.cpp @@ -59,8 +59,9 @@ int main(){ auto echo_peer_stream_p = saw::new_streaming_io_peer, encode::KelSimple, ring_buffer>(std::move(echo_stream)); std::cout<<"Got client"< error_or { + echo_peer_stream_p.second.then([&,peer_str](auto simp_resp) -> error_or { std::cout<<"Request\n"; data nat_resp; { @@ -76,7 +77,7 @@ int main(){ std::cout<send(std::move(simp_resp)); + auto eo_send = peer_str->send(std::move(simp_resp)); if(eo_send.is_error()){ auto& err = eo_send.get_error(); return std::move(err); @@ -85,7 +86,6 @@ int main(){ return make_void(); }).detach(); - auto peer_str = echo_peer_stream_p.first.get(); peer_str->on_read_disconnected().attach(std::move(echo_peer_stream_p.first)).then([]() -> error_or{ return make_error("Destroy pipeline on purpose :>"); }).detach(); -- cgit v1.2.3