Einzelnen Beitrag anzeigen

Thomas83

Registriert seit: 7. Jan 2008
180 Beiträge
 
#1

Indy. Könnte das so klappen oder gibt das nur Probleme.

  Alt 2. Mär 2008, 13:57
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
Client.WriteLn('GET_KM'); Im Server Execute bekommt er den Befehl und schickt einen neuen Befehl das jetzt die Antwort kommt.
Delphi-Quellcode:
  command := uppercase(AThread.Connection.ReadLn);
  if command = 'GET_KMthen
  begin
    AThread.Connection.WriteLn('A:GET_KM'); //Die Antwort wird gesendet
    AThread.Connection.WriteLn(fClientlist.Text);
  end;
Im Client Execute bekommt er den Befehl.
Delphi-Quellcode:
      command := uppercase(fClient.ReadLn);
      if command = 'A:GET_KMthen
      begin
        s := fClient.ReadLn;
        lbClients.Items.Text := s;
      end;
Wo drauf ich hinaus möchte ist, kommt das auch immer beim Client so an?
Delphi-Quellcode:
    AThread.Connection.WriteLn('A:GET_KM'); //Die Antwort wird gesendet
    AThread.Connection.WriteLn(fClientlist.Text);
  Mit Zitat antworten Zitat