所以,如果我想要有三个客户,我需要这样的东西:
ufds[0].fd = sd; ufds[0].events = POLLIN; ufds[1].fd = sd2; ufds[1].events = POLLOUT; ufds[2].fd = sd2; ufds[2].events = POLLOUT; ufds[3].fd = sd2; ufds[3].events = POLLOUT; ufds[4].fd = sd2; ufds[4].events = POLLOUT;
然后做什么,以便可以读入和写出信息?
以下是在Linux上使用“C”和“select”的示例:http://www.binarytides.com/multiple-socket-connections-fdset-select-Linux/
以下是使用“poll”的示例:
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_71/rzab6/poll.htm
精彩评论