请问socket编程中 
服务器未关闭 客户端却接收到FD_CLOSE信息 
为什么啊? 
引用  arong1234 的回复:
1。你说服务器没关闭,但是有些时候关闭了你根本没发现 
2。你本端的关闭也可能触发FD_CLOSE 除了这两种情况还有其他吗?

解决方案 »

  1.   

    网络正常, 调用closesocket 或者 进程关闭都会触发FD_CLOSE
      

  2.   

    MSDN:
    In TCP terms, this means that the FD_CLOSE is recorded when the connection goes into the TIME WAIT or CLOSE WAIT states. This results from the remote end performing a shutdown on the send side or a closesocket.
    连接超时,处于关闭状态,由于Shutdown或者closesocket
      

  3.   

    很奇怪,在客户端接收到FD_CLOSE后还可以和服务器正常通信
    为什么??
      

  4.   

    这个是正解,不过closesocket 没有触发此事件