做了一个网络程序,都用的tcp的Eventselect模型,当数据传完后客户端调用closesocket后,就不停的有FD_CONNECT事件,这是为什么呢

解决方案 »

  1.   

    A
      
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://feiyun0112.cnblogs.com/
      

  2.   

    要先注销事件 在closesocket()
      

  3.   

    如果你注册了FD_CONNECT事件,在关闭的时候要先取消注册该事件,
    rc = WSAEventSelect(s, hEventObject, 0);
      

  4.   

    Closing a socket with closesocket also cancels the association and selection of network events specified in WSAEventSelect for the socket. The application, however, still must call WSACloseEvent to explicitly close the event object and free any resources.