summaryrefslogtreecommitdiff
path: root/modules/io_codec/examples
diff options
context:
space:
mode:
authorClaudius 'keldu' Holeksa <mail@keldu.de>2024-08-09 18:26:48 +0200
committerClaudius 'keldu' Holeksa <mail@keldu.de>2024-08-09 18:26:48 +0200
commit17431a0c95558ed61f092fa019231df89677ca0f (patch)
treeff4934738e7a4975af552f1da4ee7343c9ec09ed /modules/io_codec/examples
parenta64b8346f39a34ef811b679bbed8131e2098e546 (diff)
wip
Diffstat (limited to 'modules/io_codec/examples')
-rw-r--r--modules/io_codec/examples/peer_echo_client.cpp4
-rw-r--r--modules/io_codec/examples/peer_echo_server.cpp3
2 files changed, 5 insertions, 2 deletions
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<void>{
+ peer_str->on_disconnected().attach(std::move(echo_peer_stream_p.first)).then([&]() -> error_or<void>{
+ keep_running = false;
+ std::cout<<"disconnect"<<std::endl;
return make_error<err::critical>("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<void>{
+ peer_str->on_disconnected().attach(std::move(echo_peer_stream_p.first)).then([]() -> error_or<void>{
+ std::cout<<"Disconnected client"<<std::endl;
return make_error<err::critical>("Destroy pipeline on purpose :>");
}).detach();
}).detach();