Lines Matching refs:fds
23 struct pollfd *fds; member
38 short revents = srvst->fds[idx].revents; in server_io_cb()
39 short *events = &srvst->fds[idx].events; in server_io_cb()
43 fd = srvst->fds[idx].fd; in server_io_cb()
65 srvst->fds[idx].fd = -1; in server_io_cb()
78 if (srvst->fds[n].fd == -1) { in server_add_state()
81 srvst->fds[n].fd = fd; in server_add_state()
82 srvst->fds[n].events = poll_events; in server_add_state()
83 srvst->fds[n].revents = 0; in server_add_state()
95 p = realloc(srvst->fds, sizeof(*srvst->fds) * (srvst->nfds + 1)); in server_add_state()
98 srvst->fds = p; in server_add_state()
99 srvst->fds[srvst->nfds].fd = fd; in server_add_state()
100 srvst->fds[srvst->nfds].events = poll_events; in server_add_state()
101 srvst->fds[srvst->nfds].revents = 0; in server_add_state()
109 short revents = srvst->fds[idx].revents; in tcp_server_accept_cb()
119 fd = accept(srvst->fds[idx].fd, sa, &len); in tcp_server_accept_cb()
140 short revents = srvst->fds[idx].revents; in udp_server_cb()
145 return srvst->cb->accept(srvst->cb->ptr, srvst->fds[idx].fd, NULL); in udp_server_cb()
182 pres = poll(srvst.fds, srvst.nfds, -1); in sock_server()
188 if (srvst.fds[n].revents) { in sock_server()
204 if (srvst.fds[n].fd != -1 && srvst.socks[n].serv && in sock_server()
205 srvst.fds[n].fd != srvst.socks[n].serv->fd) { in sock_server()
206 if (close(srvst.fds[n].fd)) in sock_server()
207 warn("sock_server: close(%d)", srvst.fds[n].fd); in sock_server()
211 free(srvst.fds); in sock_server()