Registriert seit: 26. Sep 2007
86 Beiträge
Delphi 10.2 Tokyo Enterprise
|
AW: Findcomponent TclientSocket.active := true setzen
6. Jul 2011, 13:14
von der logig ist mir das alles schon klar.
ich weiß nur nicht wie ich es im quellcode umwandel.
procedure TMainForm.Price_Info_ClientSocketA_Error(Sender: TObject; Socket: TCustomWinSocket;
ErrorEvent: TErrorEvent; var ErrorCode: Integer);
begin ....
reconnect (Client der den Fehler verursacht hat ) ; ???
end
procedure TMainForm.Reconnect( ????); > (clientsocket)
begin
Timer_PriceInfo.Interval := Pause;
Timer_PriceInfo.Enabled := True;
Memo1.clear;
Memo1.Lines.Add(Price_Info_ClientSocketE.Name +'<attempting to reconnect in '+ IntToStr(Pause) +'ms>')
procedure TMainForm.Timer_PriceInfoTimer(Sender: TObject ???); (Clientsocket)
begin
Timer_PriceInfo.Enabled := False;
try
TClientsocket(FindComponent(Price_Info_ClientSocke tE.Name)).open;
//Price_Info_ClientSocketE.Open;
//Price_Info_ClientSocketE.Active := true;
finally
If not Price_Info_ClientSocketE(Sender).active then ???
// If not (TClientsocket(FindComponent(Price_Info_ClientSock etE.Name)).active) then
//if not Price_Info_ClientSocketE.Active then
begin
Memo1.Lines.Add(Price_Info_ClientSocketE.Name +'<connection failed>');
// TClientsocket(FindComponent(Price_Info_ClientSocke tE.Name)).Active := true;
Price_Info_ClientSocketE.Active := true; ?????
Reconnect;
end;
end;
end;
end;
|