Bring up listeners after boot

This commit is contained in:
Steve Dee 2014-01-17 00:12:05 -08:00
parent 327bba824f
commit ed09e5d12e
5 changed files with 55 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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),

View File

@ -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();
}