什么是文件描述符的“异常”?

前端之家收集整理的这篇文章主要介绍了什么是文件描述符的“异常”?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
调用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.

原文链接:https://www.f2er.com/c/114777.html

猜你在找的C&C++相关文章