TIUDPClient使用過程中出了一個問題,請教一下怎麼解決

來源:互聯網
上載者:User
TIUDPClient使用過程中出了一個問題,請教一下怎麼解決 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiNetwork/html/delphi_20061211224340148.html
報錯如下  
  ‘SocketError   #   10054   Connection   reset   by   peer’  
  使用過程:  
  使用TIUDPClient發送資料,並使用ReceiveString接受伺服器反饋資訊。  
  我把ReceiveString放到一個過程中處理,此過程由TTimer控制  
  procedure   TForm1.DrawinCode;  
  var  
      Str:   String;  
      IP:   String;  
      Port:   Integer;  
  begin  
      Timer_Drawin.Enabled   :=   False;  
      Str   :=   UDPClient.ReceiveString(IP,   Port);  
      ......  
      Timer_Drawin.Enabled   :=   True;  
  end;  
  關閉視窗時  
  procedure   TForm1.FormClose(Sender:   TObject;   var   Action:   TCloseAction);  
  begin  
      UDPClient.Send(UDPClient.Binding.IP,   UDPClient.Binding.Port,   '0');  
  end;  
  來結束最後一次監聽;  
   
  ‘SocketError   #   10054   Connection   reset   by   peer’  
  錯誤在其他地方使用UDPClient發送資料時不定時出現,只能確定問題出在DrawinCode過程中,因為注釋掉Str   :=   UDPClient.ReceiveString(IP,   Port);就沒事,但不知道怎麼解決,請大家幫忙解決下,謝謝。

我查了一下,問題不是我想象的那麼簡單。就此結帖把。我多查查相關資料。進來的第一個得分結帖

呵呵

好象是個BUG,如果不影響運行就不要緊,如果運行EXE也有這提示,就用Try把它吃掉好了

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.