Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2006

Tip: Looking for answers? Try searching our database.

How to implement "More than one user Service may run within the same process"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hagaihe@gmail.com - 22 Aug 2006 14:46 GMT
Hello,
I've written a Windows service and i need help to implement the meaning
of the sentence which is generated automatically by the IDE

// More than one user Service may run within the same process. To add
            // another service to this process, change the following line to
            // create a second service object. For example,
            //
            //   ServicesToRun = new System.ServiceProcess.ServiceBase[] {new
Service1(), new MySecondUserService()};
            //

My target is basically to implement survivability of my project so if
the service will "fall down" another process / user will be able to
continue.

Does someone have any idea ??

10x.
Peter Bromberg [C# MVP] - 22 Aug 2006 15:38 GMT
if your first service blows up due to an unhandled exception, its going to
take your second "service" with it, because the process is going to go away.  
Suggest looking into a more robust alternative for whatever it is you want to
accomplish.
Peter

Signature

Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

> Hello,
> I've written a Windows service and i need help to implement the meaning
[quoted text clipped - 15 lines]
>
> 10x.
Vadym Stetsyak - 22 Aug 2006 15:59 GMT
Hello, hagaihe@gmail.com!

[skipped]

h> My target is basically to implement survivability of my project so if
h> the service will "fall down" another process / user will be able to
h> continue.

h> Does someone have any idea ??

You can start several windows services with different names, if one fails another starts operaing
instaed of  "dead" one.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Alan Pretre - 22 Aug 2006 16:03 GMT
> You can start several windows services with different names, if one fails
> another starts operaing
> instaed of  "dead" one.

You can also set the Recovery option for a service to have Windows restart
it automatically if it dies.

-- Alan
Willy Denoyette [MVP] - 24 Aug 2006 00:11 GMT
Please don't push people to start 'shadow' service processes, keep in mind
that services use precious resources not consumed by regular processes.
Better is to look at the option presented by Alan, unfortunately it's not
that easy to achieve from within .NET. Also, services should be as robust as
possible, but <rant>.NET has changed this picture, seems like everyone needs
to write a bunch of services these day's :-). Most of the time they crash or
hang or exhaust precious system resources, but no trouble start another one
when the first fails....</rant>

Willy.

| Hello, hagaihe@gmail.com!
|
[quoted text clipped - 12 lines]
| Regards, Vadym Stetsyak
| www: http://vadmyst.blogspot.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.