#include "echo.hpp" #include "../c++/io_peer.hpp" #include int main(){ using namespace saw; auto eo_aio = saw::setup_async_io(); if(eo_aio.is_error()){ auto& err = eo_aio.get_error(); std::cerr<get_network(); auto eo_addr = network.resolve_address(saw::echo_address, saw::echo_port).take(); if(eo_addr.is_error()){ return -1; } auto& addr = eo_addr.get_value(); network.connect(*addr).then([](saw::own client){ auto echo_stream = saw::heap(std::move(client)); auto echo_peer_stream_p = saw::new_streaming_io_peer(std::move(echo_stream)); echo_peer_stream_p.first->on_read_disconnected().attach(std::move(echo_peer_stream_p.first)).detach(); }).detach(); return 0; }