Create an event handler for accepting new connections in TCP or TLS domain sockets. * This works atomically for all socket fds */
| 3014 | /* Create an event handler for accepting new connections in TCP or TLS domain sockets. |
| 3015 | * This works atomically for all socket fds */ |
| 3016 | int createSocketAcceptHandler(socketFds *sfd, aeFileProc *accept_handler) { |
| 3017 | int j; |
| 3018 | |
| 3019 | for (j = 0; j < sfd->count; j++) { |
| 3020 | if (aeCreateFileEvent(server.el, sfd->fd[j], AE_READABLE, accept_handler,NULL) == AE_ERR) { |
| 3021 | /* Rollback */ |
| 3022 | for (j = j-1; j >= 0; j--) aeDeleteFileEvent(server.el, sfd->fd[j], AE_READABLE); |
| 3023 | return C_ERR; |
| 3024 | } |
| 3025 | } |
| 3026 | return C_OK; |
| 3027 | } |
| 3028 | |
| 3029 | /* Initialize a set of file descriptors to listen to the specified 'port' |
| 3030 | * binding the addresses specified in the Redis server configuration. |
no test coverage detected