| 3439 | | static void setup_listening_conns(int *l_socket, int count, const int prot) { |
|---|
| 3440 | | /* create the initial listening connection */ |
|---|
| 3441 | | int x; |
|---|
| 3442 | | int *l_socket_ptr; |
|---|
| 3443 | | for (l_socket_ptr= l_socket, x = 0; x < count; l_socket_ptr++, x++) { |
|---|
| 3444 | | conn *listen_conn_add; |
|---|
| 3445 | | if (*l_socket_ptr > -1 ) { |
|---|
| 3446 | | if (!(listen_conn_add = conn_new(*l_socket_ptr, conn_listening, |
|---|
| 3447 | | EV_READ | EV_PERSIST, |
|---|
| 3448 | | 1, prot, main_base))) { |
|---|
| 3449 | | fprintf(stderr, "failed to create listening connection\n"); |
|---|
| 3450 | | exit(EXIT_FAILURE); |
|---|
| 3451 | | } |
|---|
| 3452 | | |
|---|
| 3453 | | if (listen_conn == NULL) { |
|---|
| 3454 | | listen_conn = listen_conn_add; |
|---|
| 3455 | | } else { |
|---|
| 3456 | | listen_conn_add->next = listen_conn->next; |
|---|
| 3457 | | listen_conn->next = listen_conn_add; |
|---|
| 3458 | | } |
|---|
| 3459 | | } |
|---|
| 3460 | | } |
|---|
| 3461 | | } |
|---|
| 3462 | | |
|---|