linux网络编程之多路I/O转接服务器poll函数

(1)poll函数

           头文件:#include<poll.h>

                    int  poll(struct  pollfd*fds, nfds_t nfds,int timeout);

                    struct  pollffd{

                                    int   fd;//文件描述符

                                   short   events;//监控的事件

                                   short   revents;//监控事件中满足条件返回的事情

                          };

           参数取值:

                       

(2)使用poll实现多路转接服务器功能:

                                               

       

发布了72 篇原创文章 · 获赞 32 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/xx18030637774/article/details/82685362