What's the difference between FIONBIO and FIOASYNC for socket?
开发者_高级运维It seems both options can be used to make a socket nonblocking/asynchronous ?
Or what's the difference between nonblocking and asynchronous?
If you haven't already, you can see the difference between non-blocking and blocking sockets on the BSD sockets page on Wikipedia.
Also, you can look at the 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.
I hope this helps you out a bit.
精彩评论