轮询功能观看命名管道 [英] poll function to watch named pipes

查看:86
本文介绍了轮询功能观看命名管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图写在那里我应该看一些命名管道的两端方案
使用轮询功能。
我有一个for循环来检查每一个管每当poll返回> 0,我知道,当管道被从过程在另一端封闭,我会得到POLLHUP或POLLIN | POLLHUP中的pollfd结构的revents的领域。
我的问题是:当一个管道确实得到关闭并返回POLLHUP给我,会发生什么的下一个循环?难道要在未来的任何后续的循环或轮询功能将首先POLLHUP后忽略它一次又一次地返回POLLHUP?

I am trying to write a program where i am supposed to watch the ends of some named pipes using poll function. I have a for loop to check every pipe whenever poll returns >0 and i know that when a pipe gets closed from the procedure at the other end, i will get POLLHUP or POLLIN | POLLHUP in the revents field of the pollfd struct. My question is: when one pipe does indeed get closed and returns POLLHUP to me, what will happen on the next loop? Is it going to return POLLHUP again and again in the next and any subsequent loop or is poll function going to ignore it after the first POLLHUP?

谢谢,
尼科斯

thanks, Nikos

推荐答案

这将继续把POLLHUP revents中。结果
此外,请参阅 http://linux.die.net/man/3/poll 为参考。

It will continue to set POLLHUP in revents.
Also, see http://linux.die.net/man/3/poll for reference.

这篇关于轮询功能观看命名管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆