AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Indy Record sendeproblem
Thema durchsuchen
Ansicht
Themen-Optionen

Indy Record sendeproblem

Ein Thema von Bahamutsfire · begonnen am 13. Jan 2008 · letzter Beitrag vom 14. Feb 2008
 
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
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:15 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz