Drop the MAX_CONNS macro and define TCP_CONNECTION_LIMIT, TCP_POLL_CAPACITY, TCP_EVENT_CAPACITY instead

This commit is contained in:
2025-11-22 22:59:32 +01:00
parent 582893be70
commit e1fa3729c6
10 changed files with 54 additions and 31 deletions
+6 -6
View File
@@ -343,8 +343,8 @@ int spawn_simulated_process(char *args)
process->desc[i].generation = 0;
}
void *contexts[MAX_CONNS+1];
struct pollfd polled[MAX_CONNS+1];
void *contexts[TCP_POLL_CAPACITY];
struct pollfd polled[TCP_POLL_CAPACITY];
int num_polled;
int timeout = -1;
@@ -711,8 +711,8 @@ void update_simulation(void)
current_process = processes[i];
void *contexts[MAX_CONNS+1];
struct pollfd polled[MAX_CONNS+1];
void *contexts[TCP_POLL_CAPACITY];
struct pollfd polled[TCP_POLL_CAPACITY];
int num_polled = setup_poll_array(contexts, polled);
if (num_polled > 0) {
@@ -787,8 +787,8 @@ void update_simulation(void)
current_process = next_process;
void *contexts[MAX_CONNS+1];
struct pollfd polled[MAX_CONNS+1];
void *contexts[TCP_POLL_CAPACITY];
struct pollfd polled[TCP_POLL_CAPACITY];
int num_polled = setup_poll_array(contexts, polled);
int timeout = -1;