Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 960 Bytes

blocking-i-o-2.md

File metadata and controls

18 lines (11 loc) · 960 Bytes
description ms.assetid title ms.topic ms.date
The simplest form of I/O in Windows Sockets 2 is blocking I/O.
8ed7e5a8-c577-4b61-9c49-8fd065d84af4
Blocking Input/Output
article
05/31/2018

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).