|
|
|
|||||
|
Windows Service suggestions
Hello all,
I am working on an Ice C# windows service(ServiceBase). I want to make sure I am opening and closing connections, freeing up resources, etc properly. I approached it like this: In service class, onStart method I invoke run method of my Ice.Application class. Within the run method I create a communicator, then object adapter, and then activate the adapter. The service seems to work fine, although I am not 100% sure I have done all that is needed. Can anyone talk me through the reccomended or correct way to provide Ice service functionality through a Windows service? Thanks a million!, Powell |
|
|||||
|
I am using C# and SSL for my service.
I have a console app that has all the same functionality that works like a charm. My service works fine when I use a simple tcp setup, but when I try the service with an SSL setup, I have problems. I think I am having difficulty figuring out how to point my service code to my config file. In a console app, it is easy to point to a config, like so: public static void Main(string[] args) { server app = new server(); int status = app.main(args, @"config.server"); .... I am having trouble determining where to do this in a windows service(ServiceBase). Any advice greatly appreciated. Thanks, Powell |
|
||||||
|
Hi,
A Windows service generally uses the system directory as its default working directory, so you have to be careful when specifying a relative pathname. I recommend using an absolute pathname instead, such as C:\MyService\config.server. You also must make sure that the service has sufficient privilege to access the configuration file. I discussed these issues in a newsletter article. Take care, - Mark |
|
||||||
|
Quote:
myservice --Ice.Config=C:\MyService\config.server In C++, the Ice::Service class allows you to install a service and include whatever command-line arguments are necessary. You would probably have to implement support for this yourself in C#. Your service can also determine the location of the configuration file at run time and then define Ice.Config or load the properties manually. Take care, - Mark |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| why I can't start icebox as as a Windows service? | kexi | Help Center | 1 | 01-18-2007 01:02 AM |
| Windows service and config file | Powell Trusler | Help Center | 1 | 10-10-2006 01:12 PM |
| Using Ice.Config with a Windows Service | iamwoodyjones | Help Center | 9 | 09-26-2006 12:14 PM |
| Glacier2 service not starting on Windows XP | rhochmuth | Help Center | 3 | 02-08-2005 01:19 PM |
| ICE Windows Service | amrufon | Help Center | 5 | 07-16-2004 09:17 AM |