gpt4 book ai didi

c - 什么是文件描述符的 "exception"?

转载 作者:太空狗 更新时间:2023-10-29 16:32:33 27 4
gpt4 key购买 nike

当调用 select() 询问哪些文件描述符有“异常”等待时,这是什么意思?

如何触发这些“异常”之一?

如果有人能给我指出一个很好的解释,那就太棒了。我一直在谷歌搜索,但找不到任何东西。

最佳答案

简短形式:当 TCP 套接字接收到带外数据时会出现异常情况。

如果您阅读选择 manual page ,您会找到对另一个名为 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.

关于c - 什么是文件描述符的 "exception"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15714602/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com