嗯,这个问题我也遇到过。同样期盼正解。(个人猜想是Windows的原因:间隔一段时间,Windows就判定程序或连接已处于假死状态...----只是猜想)偶不是来蹭分的。

解决方案 »

  1.   

    无法建立TCP/IP连接,把连接超时设短一点,也可能是防火墙的影响。
      

  2.   

    晕死一下下先……楼主咋就不知道翻翻MSDN呢?10061, WSAECONNREFUSED:
    No connection could be made because the target machine actively refused it.就是说远端机器拒绝你所请求连接的端口号,一般来说就是server端的程序没有启动(或者没有成功绑定侦听端口),或者被防火墙拦截了。
      

  3.   

    用ClientSocket做的东西总感觉有问题,现在我支持同步SOCKET
      

  4.   

    Scarlette(Lord of Borland) 说的很正确!!!
    在msdn上查查就可以找到相关资料说明!!!
    难道楼主已经强到从来不用msdn麽?那为什么还问这么弱的问题?!!
      

  5.   


    CLIENT 程序中:
    IdTCPClient1.Host := edit1.Text;
       IdTCPClient1.Port := 1025;
       if  not IdTCPClient1.Connected then
         begin
           IdTCPClient1.Connect;
           Showmessage('Connect OK !');
         end;SERVER 程序中:
      IdTcpServer1.Active := true;
      IdTcpServer1.DefaultPort := 1025;
        Button1.Enabled := false;
      Button2.Enabled := true;
      Memo1.Lines.Add(Format('IdTcpServer started at localhost:%d',[IdTcpServer1.DefaultPort]));这样算是成功绑定侦听端口了吗?请各位高手不吝赐教.