什么是文件描述符的"例外"? [英] What's a file descriptor's "exception"?

查看:144
本文介绍了什么是文件描述符的"例外"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个叫哪些文件描述符有例外等待选择()问,这是什么意思?

When one calls select() asking which file descriptors have "exceptions" waiting, what does that mean?

如何一个触发这些例外之一?

How does one trigger one of these "exceptions"?

如果任何人都可以点我的一个很好的解释,那会是真棒。我一直在谷歌上搜索,并不能找到的东西。

If anyone can point me to a nice explanation, that'd be awesome. I've been googling and can't find a thing.

推荐答案

简称:特殊情况下发生的,当TCP套接字临危带外数据

Short form: exceptional situations occur when a TCP socket recieves out of band data.

如果你读了手册页,你会发现所谓的另一个补充手册页面的引用 select_tut 与说明:

If you read the select manual page, you will find a reference to another supplementary manual page called select_tut with the explanation:

exceptfds
   This  set  is watched for "exceptional conditions".  In practice,
   only one such exceptional condition is common: the availability of
   out-of-band (OOB) data for reading from a TCP socket.  See recv(2),
   send(2), and tcp(7) for more details about OOB data.  (One other
   less common case where select(2) indicates an exceptional condition
   occurs with pseudo-terminals in packet mode; see tty_ioctl(4).)
   After select() has returned, exceptfds will be cleared of all file
   descriptors except for those for which an exceptional condition has
   occurred.

这篇关于什么是文件描述符的"例外"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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