Create an event handler for accepting new connections in TCP or TLS domain sockets. * This works atomically for all socket fds */
| 3666 | /* Create an event handler for accepting new connections in TCP or TLS domain sockets. |
| 3667 | * This works atomically for all socket fds */ |
| 3668 | int createSocketAcceptHandler(socketFds *sfd, aeFileProc *accept_handler) { |
| 3669 | int j; |
| 3670 | |
| 3671 | for (j = 0; j < sfd->count; j++) { |
| 3672 | if (aeCreateFileEvent(serverTL->el, sfd->fd[j], AE_READABLE, accept_handler,NULL) == AE_ERR) { |
| 3673 | /* Rollback */ |
| 3674 | for (j = j-1; j >= 0; j--) aeDeleteFileEvent(serverTL->el, sfd->fd[j], AE_READABLE); |
| 3675 | return C_ERR; |
| 3676 | } |
| 3677 | } |
| 3678 | return C_OK; |
| 3679 | } |
| 3680 | |
| 3681 | /* Initialize a set of file descriptors to listen to the specified 'port' |
| 3682 | * binding the addresses specified in the Redis server configuration. |
no test coverage detected