Blocking Input/Output

The simplest form of I/O in Windows Sockets 2 is blocking I/O. As mentioned in Socket Attribute Flags and Modes, sockets are created in blocking mode by default. Any I/O operation with a blocking socket will not return until the operation has been fully completed. Thus, any thread can only execute one I/O operation at a time. For example, if a thread issues a receive operation and no data is currently available, the thread will block until data becomes available and is placed into the thread's buffer. Although this is simple, it is not necessarily the most efficient way to do I/O (see Pseudo Blocking and True Blocking for more information).