Autor Beitrag
WaldSchr4T
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 19



BeitragVerfasst: So 10.04.05 11:51 
Guuuuude

die borland serversocket-komponente hat die eigenschaft

serversocket.socket.connections[i].xxx

wie kann ich dieses "i" herausfinden bei prozeduren wie OnClientError? Da gibt es ne variable
socket, aber wie ich herausfinden soll, welche "connection" das nu is, weiss ich net.
hat da einer ahnung?

thx schonmal

_________________
"Als Erwin die Ente sah, wusste er, dass es ein schlechter Tag werden würde."
- frei nach T. Pratchett
WaldSchr4T Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 19



BeitragVerfasst: So 10.04.05 12:21 
ok ok, ich habs selbst rausgefunden... die idee is mir gekommen, als ich den beitrag geschrieben hab :D und, o wunder, es klappt.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.ChatServerClientError(Sender: TObject;
  Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
  var ErrorCode: Integer);
  var i:integer;
begin
  Error(ErrorEvent);
  ErrorCode:=0;
  for i:= 0 to ChatServer.Socket.ActiveThreads-1 do
  begin
    if socket = ChatServer.Socket.Connections[i] then
      ShowMessage('OH MEIN GOTT! ES IST DER SOCKET NR '+inttostr(i)+'!')
  end;
end;


vll hilfts einem weiter...aber vielleicht bin ich auch der einzige, der das nicht sofort so gemacht hat. :cry: egal.

_________________
"Als Erwin die Ente sah, wusste er, dass es ein schlechter Tag werden würde."
- frei nach T. Pratchett
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: So 10.04.05 23:44 
Moin!

IMHO solltest du für die Schleife lieber ActiveConnections anstatt ActiveThreads nutzen...

MfG
Muetze1