Thema: Delphi Indy Record sendeproblem

Einzelnen Beitrag anzeigen

Bahamutsfire

Registriert seit: 8. Feb 2007
20 Beiträge
 
#1

Indy Record sendeproblem

  Alt 13. Jan 2008, 20:23
Hi Leute,

ich habe eine Problem mit Indy(ka welches es ist, aufjedenfall das was bei Delphi 6 pro standart drauf ist). Nun gut ich möchte verschiedene Records senden, welche ich vorher mit einer Zahl ankündige, damit der Server die richtigen Dinge ausführt.

Hier das Servererigniss vom Server
Delphi-Quellcode:
Procedure TFormSockel.IdTCPServer1Execute(AThread: TIdPeerThread);
var
  anweisung: byte;
begin
  anweisung:= AThread.Connection.ReadSmallInt;
  case anweisung of
    2: IdentifikationsAnfragen(AThread);
  end;
end;
und hier bei der Zeile bleibt er stehen(1.)
Delphi-Quellcode:
procedure IdentifikationsAnfragen(AThread: TIdPeerThread);
var
  vuser: TIdentifikationMSG;
  vplatz: byte;
  vantwort: TIdentifikationAntwort;
  vip : string;
begin
  AThread.Connection.ReadBuffer(vuser,sizeof(TIdentifikationMSG));

  vip:=AThread.Connection.Binding.PeerIP;

  vplatz:= istnochplatz;

  vantwort.userid:=0; //grundwerte
  vantwort.voll:= false;
  vantwort.nicvergeben:= false;

  If(vplatz = 0) then //voll?
    vantwort.voll:= true
  else
  begin
    if(nicktest(vuser.nickname) = true) then //Nickname testen
    begin
      vantwort.nicvergeben:= true;
    end;
  end;
......
auf dem Client findet sich das hier:
Delphi-Quellcode:
procedure handschake;
var
  vselfid : TIdentifikationMSG;
  antwort: TIdentifikationAntwort;
begin
  with Formhintergrund.IdTCPClient1 do
  begin
    Connect;
    try
      begin

        WriteSmallInt(2);// TIdentifikationMSG
        vselfid.nickname:= FormVerbinden.EditNickname.Text;

        WriteBuffer (vselfid,sizeof(vselfid));//senden



       
      end;
    except
      showmessage('Konnte nicht verbinden');
      exit;
    end;
  end;

end;
Ich hoffe ihr könnte mir helfen. Wollte es am Dienstag vorstellen, nur leider scheitert es schon hier.
Danke im Vorraus

mfg
Lukas
  Mit Zitat antworten Zitat