diff --git a/examples/echoclient.cpp b/examples/echoclient.cpp index 4680dd6..0efa50f 100644 --- a/examples/echoclient.cpp +++ b/examples/echoclient.cpp @@ -6,7 +6,7 @@ using namespace NNet; template -TVoidSuspendedTask client(TPoller& poller, TAddress addr) +TFuture client(TPoller& poller, TAddress addr) { static constexpr int maxLineSize = 4096; using TSocket = typename TPoller::TSocket; @@ -38,8 +38,8 @@ TVoidSuspendedTask client(TPoller& poller, TAddress addr) template void run(bool debug, TAddress address) { - NNet::TLoop loop; - NNet::THandle h; + TLoop loop; + TFuture h; if (debug) { h = client(loop.Poller(), std::move(address)); } else { @@ -48,7 +48,6 @@ void run(bool debug, TAddress address) while (!h.done()) { loop.Step(); } - h.destroy(); } int main(int argc, char** argv) {