0
我发现poll()函数对多路复用管道和套接字非常有用,但是我想扩展它并轮询我自己的介质,就像在实现我自己的管道中一样,并且使用poll对于POLLIN和POLLOUT事件,我该怎么做?为轮询函数做一个描述符
int self = GenerateMyPipe();
int sock = socket(...);
struct pollfd fd[2];
//Init Pollfd and Stuff...
poll(fd, 2, -1);
...
感谢您的阅读...
您使用的是Linux吗?参见[eventfd()](http://man7.org/linux/man-pages/man2/eventfd.2.html) – Barmar