Lines Matching defs:handler
162 pollmgr_add_chan(int slot, struct pollmgr_handler *handler)
165 handler->slot = -1;
169 pollmgr_add_at(slot, handler, pollmgr.chan[slot][POLLMGR_CHFD_RD], POLLIN);
178 pollmgr_add(struct pollmgr_handler *handler, SOCKET fd, int events)
196 handler->slot = -1;
209 handler->slot = -1;
227 pollmgr_add_at(slot, handler, fd, events);
233 pollmgr_add_at(int slot, struct pollmgr_handler *handler, SOCKET fd, int events)
238 pollmgr.handlers[slot] = handler;
240 handler->slot = slot;
274 pollmgr_chan_recv_ptr(struct pollmgr_handler *handler, SOCKET fd, int revents)
280 errx(EXIT_FAILURE, "chan %d: fd invalid", (int)handler->slot);
285 errx(EXIT_FAILURE, "chan %d: fd error", (int)handler->slot);
293 err(EXIT_FAILURE, "chan %d: recv", (int)handler->slot);
298 (int)handler->slot, (int)nread);
375 struct pollmgr_handler *handler;
392 /* pretend that slot handler requested deletion */
402 handler = pollmgr.handlers[i];
404 if (handler != NULL && handler->callback != NULL) {
420 nevents = (*handler->callback)(handler, fd, revents);
423 DPRINTF0(("%s: invalid handler for fd %d: ", __func__, fd));
424 if (handler == NULL) {
428 DPRINTF0(("%p (callback = NULL)\n", (void *)handler));
589 struct pollmgr_handler *handler;
597 handler = rp->ptr;
598 if (handler == NULL) {
614 * and then, after channel handler is done, we would decrement it
623 * with poll manager, we immediately abort. Since channel handler
627 * Since channel handler would always find rp->strong as it had
632 if (handler->slot < 0) { /* no longer polling */
638 return handler;