Der folgende Code hängt bei mir in D7 mit Indy TCPClient und ich verstehs nicht.
Der Server antwortet (absichtlich) nicht, und das ReadLn erzeugt einfach keinen Timeout.
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22:
| try TCPClient.Host := Host; TCPClient.Port := Port; TCPClient.Connect(5000);
if not TCPClient.Connected then begin ... end;
buffer := 'STATUS?'; TCPClient.WriteLn(buffer); buffer := TCPClient.ReadLn(#10, 2000); if TCPClient.ReadLnTimedOut then begin ... end except ... end; |