1OnReceive: Notifies this socket that there is data in the buffer for it to retrieve by calling Receive.CMySocket::OnReceive(int nErrorCode)
{
    this->Receive();
}
2OnSend: Notifies this socket that it can now send data by calling Send.CMySocket::OnSend(int nErrorCode)
{
    this->Send();
}3OnAccept: Notifies this listening socket that it can accept pending connection requests by calling Accept.CMySocket::OnAccept(int nErrorCode)
{
    this->Accept();
}4OnConnect: Notifies this connecting socket that its connection attempt completed: perhaps successfully or perhaps in error.CMySocket:;Connect();CMySocket::OnConnect(int nErrorCode)
{
}
请问是不是这样的顺序调用啊?

解决方案 »

  1.   

    我知道是事件处理函数,我的意思是:1 是不是在 OnReceive()函数体的 里面  调用 Receive()2 是不是在 OnSend()函数体的    里面  调用 Send()3 是不是在 OnAccept()函数体的  里面  调用 Accept()4 是不是在 OnConnect()函数体的 前面  调用 Connect()这四个问题我已经搞清楚了,我知道是应该这样调用的也就是说,上面四题的答案是  是我现在的问题是:在哪里有相关的资料有讲 FD_READ  
    FD_WRITE 
    FD_OOB 
    FD_ACCEPT 
    FD_CONNECT 
    FD_CLOSE 是什么时候调用的呢?FD_ACCEPT 
    FD_CONNECT这两个还比较容易调试,其余的是在什么时间被调用呢?我有看msdn,网络编程技术
    还是不是很清楚,很明确。大家给个相关的链接或者是提示就可以了,谢谢
      

  2.   

    网络变成技术上有讲啊。
    第8章,Socket I/O Models中的WSAAsyncSelect模式。
    仔细看看。再看看CAsyncSocket的实现中的CAsyncSocket::DoCallBack()函数。