Example #1
0
/*
 * Handle readable and writable file descriptors in <rfds> and <wfds>, with <nfds> set to the
 * maximum number of file descriptors that may be set in <rfds> or <wfds>.
 */
void disHandleFiles(Dispatcher *dis, int nfds, fd_set *rfds, fd_set *wfds)
{
    int fd;

    for (fd = 0; fd < nfds; fd++) {
        if (disOwnsFd(dis, fd) && FD_ISSET(fd, rfds)) disHandleReadable(dis, fd);
        if (disOwnsFd(dis, fd) && FD_ISSET(fd, wfds)) disHandleWritable(dis, fd);
    }
}
Example #2
0
/*
 * Handle readable file descriptor <fd>.
 */
void nsHandleReadable(NS *ns, int fd)
{
    disHandleReadable(&ns->dis, fd);
}