From 17431a0c95558ed61f092fa019231df89677ca0f Mon Sep 17 00:00:00 2001 From: Claudius 'keldu' Holeksa Date: Fri, 9 Aug 2024 18:26:48 +0200 Subject: wip --- modules/io_codec/examples/peer_echo_client.cpp | 4 +++- modules/io_codec/examples/peer_echo_server.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/io_codec/examples') diff --git a/modules/io_codec/examples/peer_echo_client.cpp b/modules/io_codec/examples/peer_echo_client.cpp index d923bc7..3ae67ca 100644 --- a/modules/io_codec/examples/peer_echo_client.cpp +++ b/modules/io_codec/examples/peer_echo_client.cpp @@ -76,7 +76,9 @@ int main(){ }).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{ + peer_str->on_disconnected().attach(std::move(echo_peer_stream_p.first)).then([&]() -> error_or{ + keep_running = false; + std::cout<<"disconnect"<("Destroy pipeline on purpose :>"); }).detach(); diff --git a/modules/io_codec/examples/peer_echo_server.cpp b/modules/io_codec/examples/peer_echo_server.cpp index 87bf721..d579622 100644 --- a/modules/io_codec/examples/peer_echo_server.cpp +++ b/modules/io_codec/examples/peer_echo_server.cpp @@ -86,7 +86,8 @@ int main(){ return make_void(); }).detach(); - peer_str->on_read_disconnected().attach(std::move(echo_peer_stream_p.first)).then([]() -> error_or{ + peer_str->on_disconnected().attach(std::move(echo_peer_stream_p.first)).then([]() -> error_or{ + std::cout<<"Disconnected client"<("Destroy pipeline on purpose :>"); }).detach(); }).detach(); -- cgit v1.2.3