Start several instances of service?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have written a service for a customer which copies files from a folder to a ftp server based on some settings
Now this customer wants to copy files from several folders to several ftp servers

I have made the necessary changes to my service and configuration files but just as I was done, the thought occurred
why don't they start several instances of the service instead? Is that possible, just to put each service they need in a new folder (with new configuration files) and start each service
Would there be any problem with them all having the same name

Thanks for any comments
Markus
 
Markus,

If you mean the same service name, then yes that would present a problem.
Let me offer a suggestion, why not spin off a worker thread for each job
within a single service? Then your application can either handle one job,
or many depending on a configuration file.

-Andrew
http://abaum.com/blog
 
Hi Andrew

thanks for your reply

Yes, that is what I am doing: creating a new thread for each job. I just thought that it might be possible to install a service several times

So the servicename has to be unique. Would it be possible to set the service name dynamically (this.ServiceName) and add some timestamp or something unique to the name

/Markus
 
Markus,

Yes the service name must be unique across the system, and yes you can set a
service name as runtime., something to the effect of:

ServiceInstallerInstance.ServiceName =
String.Format("YourService_{0}",jobName);
ServiceInstallerInstance.DisplayName = String.Format("Service for
({0})",jobName);

-Andrew
http://abaum.com/blog
 
Back
Top