diff --git a/include/v/vere.h b/include/v/vere.h index e3a5dda72..cd0602e24 100644 --- a/include/v/vere.h +++ b/include/v/vere.h @@ -829,6 +829,11 @@ void u2_ames_io_init(void); + /* u2_ames_io_talk(): bring up listener. + */ + void + u2_ames_io_talk(void); + /* u2_ames_io_exit(): terminate ames I/O. */ void @@ -895,6 +900,11 @@ void u2_unix_io_init(void); + /* u2_unix_io_talk(): start listening for fs events. + */ + void + u2_unix_io_talk(void); + /* u2_unix_io_exit(): terminate storage. */ void @@ -949,6 +959,11 @@ void u2_http_io_init(void); + /* u2_http_io_talk(): start http listener. + */ + void + u2_http_io_talk(void); + /* u2_http_io_exit(): terminate http I/O. */ void diff --git a/v/ames.c b/v/ames.c index 507aaebd3..9fd20cda3 100644 --- a/v/ames.c +++ b/v/ames.c @@ -322,12 +322,7 @@ u2_ames_io_init() uv_udp_getsockname(&sam_u->wax_u, (struct sockaddr *)&add_u, &add_i); c3_assert(add_u.sin_port); - por_s = ntohs(add_u.sin_port); - sam_u->por_s = por_s; - - uL(fprintf(uH, "ames: on localhost, UDP %d.\n", por_s)); - - uv_udp_recv_start(&sam_u->wax_u, _ames_alloc, _ames_recv_cb); + sam_u->por_s = ntohs(add_u.sin_port); } // Timer too. @@ -336,6 +331,17 @@ u2_ames_io_init() } } +/* u2_ames_io_talk(): start receiving ames traffic. +*/ +void +u2_ames_io_talk() +{ + u2_ames* sam_u = &u2_Host.sam_u; + + uL(fprintf(uH, "ames: on localhost, UDP %d.\n", sam_u->por_s)); + uv_udp_recv_start(&sam_u->wax_u, _ames_alloc, _ames_recv_cb); +} + /* u2_ames_io_exit(): terminate ames I/O. */ void diff --git a/v/http.c b/v/http.c index 2f06f5a44..04651733d 100644 --- a/v/http.c +++ b/v/http.c @@ -1090,14 +1090,20 @@ u2_http_io_init() htp_u->hon_u = 0; htp_u->nex_u = 0; -#if 1 - _http_start(htp_u); -#endif - htp_u->nex_u = u2_Host.htp_u; u2_Host.htp_u = htp_u; } +/* u2_http_io_talk(): bring up listener. +*/ +void +u2_http_io_talk() +{ + u2_http* htp_u = u2_Host.htp_u; + + _http_start(htp_u); +} + /* u2_http_io_poll(): poll kernel for http I/O. */ void diff --git a/v/loop.c b/v/loop.c index b431fa8ef..482445c6a 100644 --- a/v/loop.c +++ b/v/loop.c @@ -168,6 +168,16 @@ _lo_init() u2_batz_io_init(); } +/* _lo_talk(): bring up listeners across the process. +*/ +static void +_lo_talk() +{ + u2_unix_io_talk(); + u2_ames_io_talk(); + u2_http_io_talk(); +} + /* _lo_exit(): terminate I/O across the process. */ static void @@ -1853,6 +1863,7 @@ u2_lo_boot() void u2_lo_loop(u2_reck* rec_u) { + _lo_talk(); { u2_unix_ef_look(); u2_reck_plan(rec_u, u2nt(c3__gold, c3__ames, u2_nul), diff --git a/v/unix.c b/v/unix.c index 838797af1..4eedcec79 100644 --- a/v/unix.c +++ b/v/unix.c @@ -1295,6 +1295,13 @@ u2_unix_io_init(void) unx_u->sig_u = sig_u; } #endif +} + +/* u2_unix_io_talk(): start listening for fs events. +*/ +void +u2_unix_io_talk() +{ u2_unix_ef_move(); }