Autor Beitrag
monty.ms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Di 24.05.05 16:03 
Hallo

Ich hab ein kleines Problem mit meinem Chat. Es funktioniert soweit ja alles, dass problem liegt nur daran, dass beide Personen im Chat nur einmal etwas senden können, danach kommt dann die Meldung "'Es konnte keine Verbindung zum Server hergestellt werden." (siehe code)! Woran liegt das?

Hier noch mein Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
procedure TForm1.BsendenClick(Sender: TObject);
var eingabe,senden:string;
begin
eingabe:=edit2.text;
name:=edit1.Text;
edit1.Enabled:=false;
Memo1.Lines.Add(name+':  '+eingabe);
memo1.Lines.Add(' ');
senden:=name+':  '+eingabe;

with idTCPClient1 do
  try
   Connect(1000);
   WriteLn(senden);
  except
   ShowMessage('Es konnte keine Verbindung zum Server hergestellt werden.');
  end;

  end;

procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
var ausgabe:string;
begin
   ausgabe := AThread.Connection.ReadLn();
   memo1.Lines.Add(ausgabe);
   memo1.Lines.Add(' ');
end;


Ich hoffe ihr könnt mir helfen und danke im vorraus!
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Di 24.05.05 18:42 
wenn ich raten müste: weil du bereits verbunden bist :wink:

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
monty.ms Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Di 24.05.05 23:08 
mh.. =) .. verdammt! Das könnts sein.., wie trenn ich die Verbindung? Mit "disconnect" sicher oder?
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 24.05.05 23:14 
Jop. Mit idTCPClient1.Disconnect; ;)
monty.ms Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Di 24.05.05 23:18 
ok danke euch =) ..