谁有Socket完成端口的例子? ( 积分: 50 )

  • 主题发起人 主题发起人 ldfnet
  • 开始时间 开始时间
L

ldfnet

Unregistered / Unconfirmed
GUEST, unregistred user!
谁有Socket完成端口的例子?
 
谁有Socket完成端口的例子?
 
CreateIoCompletionPort((HANDLE) Accept,
CompletionPort, (DWORD) PerHandleData, 0);
DWORD byteRecv=0;
DWORD Flags=0;
int tmpResult=0;
LPPER_IO_DATA myHandlData;
myHandlData=new PER_IO_CONTEXT;
memset(&(myHandlData->Overlapped),'/0',sizeof(OVERLAPPED));
memset(myHandlData->szBuffer,'/0',4095);
myHandlData->DataBuf.buf=myHandlData->szBuffer;
myHandlData->DataBuf.len=4095;
myHandlData->sClient=Accept;
myHandlData->OperationType=RECV_POSTED;
tmpResult=WSARecv(myHandlData->sClient,&(myHandlData->DataBuf),1,&byteRecv,&Flags,&(myHandlData->Overlapped),0);
delete myHandlData;
 
接受答案了.
 
后退
顶部