请遇到 这个问题的童鞋们 回答一下 分不够在加 。
首先申明  发完消息后 closesocket()了
如果在连就链不上了 返回这个错误 。重启也是一样的,,,困扰了很久 ,,,

解决方案 »

  1.   

    有没有再次调用socket函数再次创建socket句柄?
      

  2.   

    WSAETIMEDOUT
    10060 Connection timed out. 
    A connection attempt failed because the connected party did not properly respond after a period of time, or the established connection failed because the connected host has failed to respond. 
    超时了。 
      

  3.   

    LZ你可以使用VC的辅助工具Error Lookup查错误码的~~~~
      

  4.   

    检查与服务器的网络:
    1. ping IP
    2. telnet ip port
    如果两个检查都过了, 还可能情况有: 本机有多个IP, 其中一个IP与服务器在同一网段(或者网络上连通), 但是在建立连接时本机绑定了其他IP, 不与服务器连通, 这种情况下也连不上, 绑定时应该换成连通的IP或者0.0.0.0
      

  5.   

    value: 10060
    Error:
    由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。