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