gpt4 book ai didi

c - FIONBIO 和 FIOASYNC for socket 有什么区别?

转载 作者:行者123 更新时间:2023-12-04 06:14:21 29 4
gpt4 key购买 nike

似乎这两个选项都可用于使套接字非阻塞/异步?

或者非阻塞和异步之间有什么区别?

最佳答案

如果您还没有,您可以在 BSD sockets 上看到非阻塞和阻塞套接字之间的区别。维基百科页面。

另外,您可以查看 ioctlsocket() MSDN page for a few details on FIONBIO .

According to IBM :

FIOASYNC Enables a simple form of asynchronous I/O notification. This command causes the kernel to send SIGIO signal to a process or a process group when I/O is possible. Only sockets, ttys, and pseudo-ttys implement this functionality.

FIONBIO Enables nonblocking I/O. The effect is similar to setting the O_NONBLOCK flag with the fcntl subroutine. The third parameter to the ioctl subroutine for this command is a pointer to an integer that indicates whether nonblocking I/O is being enabled or disabled. A value of 0 disables non-blocking I/O.



我希望这对你有所帮助。

关于c - FIONBIO 和 FIOASYNC for socket 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7440571/

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