本帖最后由 VisualEleven 于 2011-01-24 17:00:52 编辑

解决方案 »

  1.   

    socket资源泄漏,耗尽.最后影响网络服务
      

  2.   

    closesocket是连接方的是吧,MSDN上也没看到要用这个的
      

  3.   

    socket 一直连接,没有有太大的问题。
      

  4.   

    The closesocket function closes a socket. Use it to release the socket descriptor s so that further references to s fail with the error WSAENOTSOCK. If this is the last reference to an underlying socket, the associated naming information and queued data are discarded. Any pending blocking, asynchronous calls issued by any thread in this process are canceled without posting any notification messages.
      

  5.   

    这种连接多了的话,服务器响应客户端的请求会越来越慢,最后占满了所有端口,导致再也无法响应新的连接。
    而且,客户端也会收到连接,一直保持在FIN_WATI状态。