Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Codesire-Deng/co_context
/ server
Function
server
example/echo_server.cpp:14–19 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
12
}
13
14
task<> server(const uint16_t port) {
15
acceptor ac{inet_address{port}};
16
for (int sock; (sock = co_await ac.accept()) >= 0;) {
17
co_spawn(session(sock));
18
}
19
}
20
21
int main() {
22
io_context ctx;
Callers
1
main
Function · 0.70
Calls
3
co_spawn
Function · 0.85
accept
Method · 0.80
session
Function · 0.70
Tested by
no test coverage detected