采用TCP,当服务停止后,客户端CONNECT后不会报错,这是为什么???急急

解决方案 »

  1.   

    楼上说的有道理,处理方式如下:
      pStream := TWinSocketStream.Create(ClientSocket,60000);
      try
        while (not Terminated) and ClientSocket.Connected do
        begin
          try
            Buffer := AllocMem(ReadLen);       
            if pStream.WaitForData(500) then 
            begin
              {...... 一大堆处理过程 .......}
            end else
            begin        {超时的情况}
              {...... 一大堆处理过程 .......}
            end;