![]() |
Indy. Könnte das so klappen oder gibt das nur Probleme.
hi,
bei meiner Netzwerkanwendung mit indy möchte ich gerne die Kommunikation wie folgt aufbauen. Client möchte daten vom Server und schickt einen Befehl
Delphi-Quellcode:
Im Server Execute bekommt er den Befehl und schickt einen neuen Befehl das jetzt die Antwort kommt.
Client.WriteLn('GET_KM');
Delphi-Quellcode:
Im Client Execute bekommt er den Befehl.
command := uppercase(AThread.Connection.ReadLn);
if command = 'GET_KM' then begin AThread.Connection.WriteLn('A:GET_KM'); //Die Antwort wird gesendet AThread.Connection.WriteLn(fClientlist.Text); end;
Delphi-Quellcode:
Wo drauf ich hinaus möchte ist, kommt das auch immer beim Client so an?
command := uppercase(fClient.ReadLn);
if command = 'A:GET_KM' then begin s := fClient.ReadLn; lbClients.Items.Text := s; end;
Delphi-Quellcode:
AThread.Connection.WriteLn('A:GET_KM'); //Die Antwort wird gesendet
AThread.Connection.WriteLn(fClientlist.Text); |
Re: Indy. Könnte das so klappen oder gibt das nur Probleme.
hat sich erledigt, habe es anders gelöst.
|
Re: Indy. Könnte das so klappen oder gibt das nur Probleme.
Dann erklär doch mal wie!
|
Re: Indy. Könnte das so klappen oder gibt das nur Probleme.
mache es simpel mit einer TStringList.
Also Beim Client list.add(befehl); list.add(befehl2); list.add(daten); Client.SendText(list.text); list.free; Beim Server list.text := Server.ReadLn; if list.string[0] = 'Befehl1' then ... list.string[2]; // Mach was mit Daten |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:39 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