예제 #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);
    }
}
예제 #2
0
/*
 * Handle writable file descriptor <fd>.
 */
void nsHandleWritable(NS *ns, int fd)
{
    disHandleWritable(&ns->dis, fd);
}