Autor Beitrag
Force
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 143

Ubuntu Jaunty
FreePascal
BeitragVerfasst: So 22.01.06 18:19 
Hi!

Ich hab schon versucht, mit TServerSocket einen String zu senden, allerdings kommt dann die Meldung, dass der Socket nicht verbunden wäre...ich will den String mit

ServerSocket1.socket.sendtext('DerText')

schicken, aber dann kommt halt die oben genannte Meldung...woran liegt das? Ich hab schon versucht irgendwie die Client-IP da mit rein zubringen - na ja, hat nicht geklappt...

Muss ich einen anderen Befehl benutzen?

Thx,

Force
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 22.01.06 18:27 
Hallo,

dieses Problem hatte ich auchmal.
Ist nur ein Client verbunden?
Dann probiers so:

ausblenden Delphi-Quelltext
1:
serversocket1.socket.connections[0].sendtext('Deutscher Meister wird nur der BVB!');					


Mit der Zahl in den eckigen Klammern kannst du festlegen, an welchen Client du senden willst, da ja mehrere Clients sich mit dem Serversocket verbinden können.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Force Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 143

Ubuntu Jaunty
FreePascal
BeitragVerfasst: So 22.01.06 18:31 
Super!!! Vielen Dank!
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: So 22.01.06 20:06 
Das Funktioniert nur solange du nur einen Klienten dran hängen hast.
Aber falls du X-Beliebige hast hilft dir dieser Code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var i : Integer;
begin
  
  For i := 0 To ServerSocket1.Socket.ActiveConnections -1 do begin
  
    ServerSocket1.Socket.Connections[I].SendText('Dein Text . . .');  
  
  end;
  
  
end;

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 22.01.06 20:14 
Das ist zwar eigentlich unwichtig, aber man kann doch das begin und end weglassen, oder?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
bs-Hobbit
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46

Windows Xp (Home/Prof.), Windows Server 2003, Linux
D7,D2005
BeitragVerfasst: So 22.01.06 21:49 
jop kann man weglassen :) aber ich mache das immer hin, man kann ja nie wissen, ob noch was hinzukommt
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 23.01.06 00:14 
Moin!

Ich verweise auch noch mal auf die FAQ. :wink:

cu
Narses