Lines Matching refs:poller
183 php_cli_server_poller poller; member
730 static int php_cli_server_poller_ctor(php_cli_server_poller *poller) /* {{{ */ in php_cli_server_poller_ctor() argument
732 FD_ZERO(&poller->rfds); in php_cli_server_poller_ctor()
733 FD_ZERO(&poller->wfds); in php_cli_server_poller_ctor()
734 poller->max_fd = -1; in php_cli_server_poller_ctor()
738 static void php_cli_server_poller_add(php_cli_server_poller *poller, int mode, int fd) /* {{{ */ in php_cli_server_poller_add() argument
741 PHP_SAFE_FD_SET(fd, &poller->rfds); in php_cli_server_poller_add()
744 PHP_SAFE_FD_SET(fd, &poller->wfds); in php_cli_server_poller_add()
746 if (fd > poller->max_fd) { in php_cli_server_poller_add()
747 poller->max_fd = fd; in php_cli_server_poller_add()
751 static void php_cli_server_poller_remove(php_cli_server_poller *poller, int mode, int fd) /* {{{ */ in php_cli_server_poller_remove() argument
754 PHP_SAFE_FD_CLR(fd, &poller->rfds); in php_cli_server_poller_remove()
757 PHP_SAFE_FD_CLR(fd, &poller->wfds); in php_cli_server_poller_remove()
760 if (fd == poller->max_fd) { in php_cli_server_poller_remove()
763 if (PHP_SAFE_FD_ISSET(fd, &poller->rfds) || PHP_SAFE_FD_ISSET(fd, &poller->wfds)) { in php_cli_server_poller_remove()
767 poller->max_fd = fd; in php_cli_server_poller_remove()
772 static int php_cli_server_poller_poll(php_cli_server_poller *poller, struct timeval *tv) /* {{{ */ in php_cli_server_poller_poll() argument
774 memmove(&poller->active.rfds, &poller->rfds, sizeof(poller->rfds)); in php_cli_server_poller_poll()
775 memmove(&poller->active.wfds, &poller->wfds, sizeof(poller->wfds)); in php_cli_server_poller_poll()
776 return php_select(poller->max_fd + 1, &poller->active.rfds, &poller->active.wfds, NULL, tv); in php_cli_server_poller_poll()
779 static int php_cli_server_poller_iter_on_active(php_cli_server_poller *poller, void *opaque, int(*c… in php_cli_server_poller_iter_on_active() argument
791 for (i = 0; i < poller->active.rfds.fd_count; i++) { in php_cli_server_poller_iter_on_active()
793 n->fd = poller->active.rfds.fd_array[i]; in php_cli_server_poller_iter_on_active()
798 for (i = 0; i < poller->active.wfds.fd_count; i++) { in php_cli_server_poller_iter_on_active()
800 SOCKET fd = poller->active.wfds.fd_array[i]; in php_cli_server_poller_iter_on_active()
825 const php_socket_t max_fd = poller->max_fd; in php_cli_server_poller_iter_on_active()
828 if (PHP_SAFE_FD_ISSET(fd, &poller->active.rfds)) { in php_cli_server_poller_iter_on_active()
833 if (PHP_SAFE_FD_ISSET(fd, &poller->active.wfds)) { in php_cli_server_poller_iter_on_active()
1861 php_cli_server_poller_add(&server->poller, POLLOUT, client->sock); in php_cli_server_send_error_page()
1951 php_cli_server_poller_add(&server->poller, POLLOUT, client->sock); in php_cli_server_begin_send_static()
2102 php_cli_server_poller_remove(&(*p)->server->poller, POLLIN | POLLOUT, (*p)->sock); in php_cli_server_client_dtor_wrapper()
2165 err = php_cli_server_poller_ctor(&server->poller); in php_cli_server_ctor()
2170 php_cli_server_poller_add(&server->poller, POLLIN, server_sock); in php_cli_server_ctor()
2233 php_cli_server_poller_remove(&server->poller, POLLIN, client->sock); in php_cli_server_recv_event_read_request()
2236 php_cli_server_poller_add(&server->poller, POLLIN, client->sock); in php_cli_server_recv_event_read_request()
2346 …php_cli_server_poller_iter_on_active(&server->poller, ¶ms, php_cli_server_do_event_for_each_fd… in php_cli_server_do_event_for_each_fd()
2354 int n = php_cli_server_poller_poll(&server->poller, &tv); in php_cli_server_do_event_loop()