typedef struct{
OVERLAPPED Overlapped;
WSABUF DataBuf;
CHAR Buffer [DATA_BUFERSIZE];
DWORD BytesSEND;
DWORD BytesTECB;}PER_IO_OPERATION_DATA,*LPPER_IO_OPERATION_DATA;
typedef struct
{
SOCKET Socket;
}PER_HANDLE_DATA,*LPPER_HANDLE_DATA;
//服务器接收数据线程
DWORD WINAPI ServerWorkerThread(LPVOID CompletionPortID)
{
HANDLE CompletionPort=(HANDLE) CompletionPortID;
DWORD BytesTransferred;
LPPER_HANDLE_DATA PerHandleData;
LPPER_IO_OPERATION_DATA PerIoData;
DWORD SendBytes,RecbBytes;
DWORD Flags;
while(TRUE)
{
if (GetQueuedCompletionStatus(CompletionPort,&BytesTransferred,(LPDWORD)&PerHandleData,(LPOVERLAPPED *)&PerIoData,INFINITE)==0)
////////有三个问题:(1)函数GetQueuedCompletionStatus()对实参PerHandleData、PerIoData如何处理?(2)这个过程函数是不是对变量PerHandleData、PerIoData赋值?(3)前面定义了两个结构体,结构体对象作PerHandleData、PerIoData为实参。
{
reurn 0;
}
......
}
慕后森
相关分类