When one calls select() asking which file descriptors have "exceptions" waiting, what does that mean?
当一个人调用select()询问哪些文件描述符有“异常”等待时,这是什么意思?
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.
如果有人能给我一个很好的解释,那就太棒了。我一直在谷歌搜索,无法找到一件事。
2 个解决方案
#1
10
Short form: exceptional situations occur when a TCP socket recieves out of band data.
简短形式:TCP套接字接收带外数据时会出现异常情况。
If you read the select
manual page, you will find a reference to another supplementary manual page called select_tut
with the explanation:
如果您阅读了选择手册页,您将找到另一个名为select_tut的补充手册页的参考,其中包含以下说明:
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.
这套装置被视为“特殊条件”。实际上,只有一种这样的异常情况是常见的:用于从TCP套接字读取的带外(OOB)数据的可用性。有关OOB数据的更多详细信息,请参阅recv(2),send(2)和tcp(7)。 (另一种不太常见的情况,其中select(2)表示在数据包模式下伪终端出现异常情况;请参阅tty_ioctl(4)。)select()返回后,除了fds之外,将清除除了所有文件描述符之外的所有文件描述符这是一种特殊情况。
#2
2
Indeed there seems to be very little information on this. Thankfully there's an existing question with a very good answer.
事实上,关于此的信息似乎很少。值得庆幸的是,现有的问题有一个非常好的答案。
In the case of Linux, for example, it can denote out-of-band data being received on a stream socket, or "a state change occuring on a pseudoterminal slave connected to a master that is in packet mode" (TLPI 63.2.1).
例如,在Linux的情况下,它可以表示在流套接字上接收的带外数据,或者“在连接到处于分组模式的主设备的伪终端从设备上发生的状态改变”(TLPI 63.2.1) )。
#1
10
Short form: exceptional situations occur when a TCP socket recieves out of band data.
简短形式:TCP套接字接收带外数据时会出现异常情况。
If you read the select
manual page, you will find a reference to another supplementary manual page called select_tut
with the explanation:
如果您阅读了选择手册页,您将找到另一个名为select_tut的补充手册页的参考,其中包含以下说明:
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.
这套装置被视为“特殊条件”。实际上,只有一种这样的异常情况是常见的:用于从TCP套接字读取的带外(OOB)数据的可用性。有关OOB数据的更多详细信息,请参阅recv(2),send(2)和tcp(7)。 (另一种不太常见的情况,其中select(2)表示在数据包模式下伪终端出现异常情况;请参阅tty_ioctl(4)。)select()返回后,除了fds之外,将清除除了所有文件描述符之外的所有文件描述符这是一种特殊情况。
#2
2
Indeed there seems to be very little information on this. Thankfully there's an existing question with a very good answer.
事实上,关于此的信息似乎很少。值得庆幸的是,现有的问题有一个非常好的答案。
In the case of Linux, for example, it can denote out-of-band data being received on a stream socket, or "a state change occuring on a pseudoterminal slave connected to a master that is in packet mode" (TLPI 63.2.1).
例如,在Linux的情况下,它可以表示在流套接字上接收的带外数据,或者“在连接到处于分组模式的主设备的伪终端从设备上发生的状态改变”(TLPI 63.2.1) )。