Created
November 30, 2021 11:20
-
-
Save HappyCerberus/d94965520ef69f126c811fb3225f5644 to your computer and use it in GitHub Desktop.
[Article] C++20 Practical Coroutines - main detached
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto &sched = ces::main_scheduler(); | |
sched.register_emitter(std::make_unique<ces::TimeoutEmitter>()); | |
sched.register_emitter(std::make_unique<ces::ConditionEmitter>()); | |
sched.register_emitter(std::make_unique<ces::EpollEmitter>()); | |
ces::Socket s = | |
ces::Socket::ServerSocket(ces::SockAddr(ces::IPv4{}, "127.0.0.1", 9090)); | |
auto server = async_server(s.without_timeout(), echo_server_handle); | |
auto client = echo_client(s.without_timeout()); | |
sched.schedule(server); | |
sched.schedule(client); | |
sched.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment