procedure TFrm_Interfaces.ServerConnect(AThread: TIdPeerThread);
var
NewClient: PClient;
MisComponentes:tmisComponentes;
begin
GetMem(NewClient, SizeOf(TClient));
NewClient.DNS := AThread.Connection.LocalName;
NewClient.Connected := Now;
NewClient.LastAction := NewClient.Connected;
NewClient.Thread :=AThread;
AThread.Data:=TObject(NewClient);
CoInitialize(nil);
MisComponentes := tmisComponentes.Create;
MisComponentes.Conexion := TADOConnection.Create(self);
MisComponentes.Query := TADOQUERY.Create(Self);
MisComponentes.Conexion1 := TZConnection.Create(self);
MisComponentes.Query1 := TZquery.Create(Self);
AThread.Data := @MisComponentes;
try
Clients.LockList.Add(NewClient);
finally
Clients.UnlockList;
end;
Protocol.Lines.Add(TimeToStr(Time)+' The connection to '+NewClient.DNS+' was connected');
end;