Win32 socket blocking and non-blocking functions and settings, win32socket
Some functions in win32 socket are blocked by default, such as accept (), send (), recv (), etc. The blocking concepts of send () and recv () and accept () are as follows () the concept of blocking is different.
The send () and recv () functions only copy data, that is, the send () function only puts data into the sending buffer, and the actual sending work is completed by the network protocol; recv () the function only reads data from the receiving buffer, and the operation of actually receiving data is completed by the network protocol. The blocking of send () is mainly caused by the completion of the sending buffer, and the blocking of recv () is caused by the absence of data readable in the receiving buffer.
The socket blocking and non-blocking settings are completed by the ioctrlsocket () function, and the corresponding blocking time limit is set by the setsockopt () function.. For more information, see references.
Reference 1 related setting functions
References 2 Concepts