Sockets 使用kqueue轮询异常情况
我正在修改一个应用程序,以便用kqueue替换它对select()的使用。select()允许对异常情况进行轮询:Sockets 使用kqueue轮询异常情况,sockets,kqueue,Sockets,Kqueue,我正在修改一个应用程序,以便用kqueue替换它对select()的使用。select()允许对异常情况进行轮询: int select(int nfds, fd_set *restrict readfds, fd_set *restrict writefds, fd_set *restrict errorfds, <---- this thing here struct timeval *restrict timeout );
int select(int nfds,
fd_set *restrict readfds,
fd_set *restrict writefds,
fd_set *restrict errorfds, <---- this thing here
struct timeval *restrict timeout
);
int-select(int-nfds,
fd_集*限制读取FDS,
fd_集*限制写入,
fd_set*restrict error FDS,FreeBSD上没有异常状态,引用man 2 select
:
唯一可检测到的异常情况是在套接字上接收的带外数据
所以你的问题可以归结为“我如何用kqueue检测套接字上的OOB数据”,老实说,如果不做一些研究,我无法回答这个问题