![]() |
Indy 10: Der Server empfängt keine Daten
Hallo,
wenn ich mit Indy einen Server erstelle (Delphi.Net) und mit diesem Daten empfangen will, bekomm ich im eine Exception und der Server schließt den Host: Die Server OnExecute Funktion sieht so aus:
Delphi-Quellcode:
procedure TformMain.tcpsTestExecute(AContext: TIdContext);
var s: string; begin try with AContext.Connection do begin s := IOHandler.ReadLn; //HIER BLEIBT ER STEHEN : Danach Connection Closed Gracefully. IOHandler.WriteLn('Hello ' + s); end; except on E: Exception do Console.write(e.message); end; end; Der Client sieht so aus:
Delphi-Quellcode:
Wo liegt mein Fehler???
uses
IdTCPClient, SysUtils; begin with TIdTCPClient.Create do try Host := '127.0.0.2'; Port := 10001; Connect; try WriteLn('Connected.'); WriteLn(IOHandler.ReadLn); IOHandler.WriteLn('Quit'); WriteLn(IOHandler.ReadLn); finally Disconnect; end; WriteLn('Disconnected.'); finally Free; end; WriteLn('Press Enter'); ReadLn; end. Danke, winx |
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:57 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz