Continue work on DST framework

This commit is contained in:
2025-10-29 21:46:17 +01:00
parent 24c0134c03
commit 174f37c6c0
17 changed files with 1407 additions and 710 deletions
+6 -5
View File
@@ -147,11 +147,8 @@ void tcp_consume_message(TCP *tcp, int conn_idx)
tcp->conns[conn_idx].msglen = 0;
}
// The "events" array must be an array of capacity MAX_CONNS+1
int tcp_process_events(TCP *tcp, Event *events)
int tcp_register_events(TCP *tcp, void **contexts, struct pollfd *polled)
{
struct pollfd polled[MAX_CONNS + 1];
void *contexts[MAX_CONNS + 1];
int num_polled = 0;
if (tcp->listen_fd != INVALID_SOCKET && tcp->num_conns < MAX_CONNS) {
@@ -173,8 +170,12 @@ int tcp_process_events(TCP *tcp, Event *events)
}
}
sys_poll(polled, num_polled, -1);
return 0;
}
// The "events" array must be an array of capacity MAX_CONNS+1
int tcp_translate_events(TCP *tcp, Event *events, void **contexts, struct pollfd *polled, int num_polled)
{
bool removed[MAX_CONNS+1];
int num_events = 0;