Autor Beitrag
madigeMade
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Do 03.04.03 21:11 
Hi @ all!

Bin jetzt mal am programmieren mit Indy und hab des Problem beim Beenden mit einer aktiven TCP Verbindung kommt ne Fehlermeldung. Wie kann ich eine aktive Verbindung in einem anderen Formular beenden und was muss ich beim Beenden noch beachten?

Gruß de Made

_________________
Ich kam, sah und schrieb ein Prog.
O'rallY
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 563



BeitragVerfasst: Do 03.04.03 21:16 
Es wäre hilfreich, wenn du dein Problem näher beschreiben würdest. Wie du die Verbindung kappst, welcher Fehler auftritt etc. pp.

_________________
.oO'rallY
Linux is like a tipi: No gates, no windows and a gnu-eating apache inside...
madigeMade Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Fr 04.04.03 21:35 
Hi!

Das würd ich ja gerne wissen. Ich bin am programmieren eines Spiels und bin grad beim Thema Multiplayer. Und jetzt würd ich gerne wissen wie ich eine aktive Verbindung (TCP und UDP Client und Server) kappe.
Beim Beenden ohne kappen kommt ne EAccessViolation.

Danke und Gruß de Made

_________________
Ich kam, sah und schrieb ein Prog.
O'rallY
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 563



BeitragVerfasst: So 06.04.03 13:23 
Wegen UDP kannst du mal ins FAQ gucken. Da hab ich einen kleinen Artikel geschrieben. TCP:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TfrmServer.FormCreate(Sender: TObject);
begin
  TCPServer.Active := True;
end;
procedure TfrmServer.TCPServerExecute(AThread: TIdPeerThread);
begin
  with AThread.Connection do
  begin
    WriteLn('Hello from Basic Indy Server server.');
    Disconnect;
  end;
end;

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm2.btnGoClick(Sender: TObject);
begin
  with TCPClient do begin
    Connect;
    try
      lstMain.Items.Add(ReadLn);
    finally
      Disconnect;
    end;
  end;
end;

_________________
.oO'rallY
Linux is like a tipi: No gates, no windows and a gnu-eating apache inside...