diff options
Diffstat (limited to 'modules/io_codec/examples')
-rw-r--r-- | modules/io_codec/examples/peer_echo_server.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/io_codec/examples/peer_echo_server.cpp b/modules/io_codec/examples/peer_echo_server.cpp index 279db92..02a7272 100644 --- a/modules/io_codec/examples/peer_echo_server.cpp +++ b/modules/io_codec/examples/peer_echo_server.cpp @@ -84,8 +84,9 @@ int main(){ } return make_void(); }).detach(); - - echo_peer_stream_p.first->on_read_disconnected().attach(std::move(echo_peer_stream_p.first)).then([]() -> error_or<void>{ + + 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>{ return make_error<err::critical>("Destroy pipeline on purpose :>"); }).detach(); }).detach(); |