예제 #1
0
void select_handle_accept(select_t *sel)
{
	if(FD_ISSET(sel->listenfd_, &sel->rset_))
	{
		int peerfd = accept(sel->listenfd_, NULL, NULL);
		if(peerfd == -1)
			ERR_EXIT("accept");
		printf("client on\n");
		select_add_fd(sel, peerfd);
	}
}
예제 #2
0
void select_handle_accept(select_t *sel)
{
    if(FD_ISSET(sel->listenfd_, &sel->rset_))
    {
        int peerfd = accept(sel->listenfd_, NULL, NULL);
        if(peerfd == -1)
            ERR_EXIT("accept");
        select_add_fd(sel, peerfd);
        --sel->nready_;
    }
}
예제 #3
0
void select_handle_accept(select_t *sel)
{
    if(FD_ISSET(sel->listenfd, &sel->rset))
    {
        int peerfd = accept(sel->listenfd, NULL, NULL);
        if(peerfd == -1)
        {
            ERR_EXIT("accpet");
        }
        select_add_fd(sel, peerfd);
    }
}