OVERLAPPED
OVERLAPPED结构类型声明如下:
typedef struct _OVERLAPPED{
DWORD Internal;//操作系统保留,指出一个和系统相关的状态
DWORD InternalHigh;//指出发送或接收的数据长度
DWORD Offset;//文件传送的开始位置
DWORD OffsetHigh;//文件传送的字节偏移量的高位字
HANDLE hEvent;//指定一个I/O操作完成后触发的事件
}OVERLAPPED;
OVERLAPPED主要是设置异步I/O操作,异步I/O操作是指应用程序可以在后台读或者写数据,而在前台做其他事情。
Allen denver在他的《Serial Communication in Win32》中是这样解释OVERLAPPED I/O的:我个人认为还是比较准确的
Overlapped I/O is not as straightforward as nonoverlapped I/O, but allows more flexibility and efficiency. A port open for overlapped operations allows multiple threads to do I/O operations at the same time and perform other work while the operations are pending. Furthermore, the behavior of overlapped operations allows a single thread to issue many different requests and do work in the background while the operations are pending.