Something I'd like to clarify, as I seem to have had the wrong impression when using the above event handler (in a service application):
At design-time I have components SparkleHttpSysDispatcher and SphinxServer with property BaseUrl = ''.
I implemented the following:
procedure TMySphinxService.ServiceStart(Sender: TService; var Started: Boolean);
begin
MyServerContainer.SparkleHttpSysDispatcher.Start;
end;
and then
procedure MyServerContainer.SparkleHttpSysDispatcherStart(Sender: TObject);
begin
ReadConfigFromIni; // Sets SphinxServer.BaseUrl from ini file (amongst other settings)
end;
I figured this would work but some how it results in an error that the URL cannot be set (as it's empty).
I have now changed to:
procedure TMySphinxService.ServiceStart(Sender: TService; var Started: Boolean);
begin
MyServerContainer.ReadConfigFromIni; // Moved to public declarations.
MyServerContainer.SparkleHttpSysDispatcher.Start;
end;
This works fine. I would assume that OnStart is only triggered if the SparkleHttpSysDispatcher is not active. Or is this an incorrect assumption?