#include #include #include #include #include #define USE_CONFIG_COROUTINE #include "config.h" int main() { int sock = netio_listen(9000); if (sock < 0) error(1, -sock, "netio_listen"); struct lib9p_srv srv = { .sockfd = sock, }; for (int i = 0; i < CONFIG_NETIO_NUM_CONNS; i++) if (!coroutine_add(lib9p_srv_read_cr, &srv)) error(1, 0, "coroutine_add(lib9p_srv_read_cr, &srv)"); for (int i = 0; i < 2*CONFIG_NETIO_NUM_CONNS; i++) if (!coroutine_add(lib9p_srv_write_cr, &srv)) error(1, 0, "coroutine_add(lib9p_srv_write_cr, &srv)"); coroutine_main(); return 1; }