Lines Matching refs:handler

39 netio_add_handler(netio_type *netio, netio_handler_type *handler)  in netio_add_handler()  argument
44 assert(handler); in netio_add_handler()
62 elt->handler = handler; in netio_add_handler()
63 elt->handler->pfd = -1; in netio_add_handler()
68 netio_remove_handler(netio_type *netio, netio_handler_type *handler) in netio_remove_handler() argument
73 assert(handler); in netio_remove_handler()
76 if ((*elt_ptr)->handler == handler) { in netio_remove_handler()
80 (*elt_ptr)->handler = NULL; in netio_remove_handler()
145 netio_handler_type *handler = elt->handler; in netio_dispatch() local
146 if (handler->fd != -1 && numfd < MAX_NETIO_FDS) { in netio_dispatch()
147 fds[numfd].fd = handler->fd; in netio_dispatch()
150 handler->pfd = numfd; in netio_dispatch()
151 if (handler->event_types & NETIO_EVENT_READ) { in netio_dispatch()
154 if (handler->event_types & NETIO_EVENT_WRITE) { in netio_dispatch()
159 handler->pfd = -1; in netio_dispatch()
161 if (handler->timeout && (handler->event_types & NETIO_EVENT_TIMEOUT)) { in netio_dispatch()
164 relative.tv_sec = handler->timeout->tv_sec; in netio_dispatch()
165 relative.tv_nsec = handler->timeout->tv_nsec; in netio_dispatch()
174 timeout_handler = handler; in netio_dispatch()
233 netio_handler_type *handler = elt->handler; in netio_dispatch() local
235 if (handler->fd != -1 && handler->pfd != -1) { in netio_dispatch()
238 if ((fds[handler->pfd].revents & POLLIN)) { in netio_dispatch()
241 if ((fds[handler->pfd].revents & POLLOUT)) { in netio_dispatch()
244 if ((fds[handler->pfd].revents & in netio_dispatch()
248 if((handler->event_types&NETIO_EVENT_READ)) in netio_dispatch()
250 else if((handler->event_types&NETIO_EVENT_WRITE)) in netio_dispatch()
254 if (event_types & handler->event_types) { in netio_dispatch()
255 handler->event_handler(netio, handler, event_types & handler->event_types); in netio_dispatch()