Windows Service and Remoting

T

Tom Simpson

I have set up a Windows service in VB.NET, and created a
'Service Manager' Windows Forms app that can 'get'
information from that service. The service consists of the
basic service 'framework' along with a large class that I
wrote that actually does all the work. The Service Manager
app uses .NET remoting to get info into/back from the
service.

I have a couple of questions that I need info on before I
complete this service:

1. When you do a Stop and Start, does the service actually
get unloaded out of memory then reloaded back in? From what
I understood, a service get 'loaded' when the
server/computer starts up, and then is 'started' when the
Start command is issued. However, I saw some comments out
there that seemed to say the service actually gets unloaded
from memory when STOP is called.

2. Is there a way I can tap into when the service actually
first gets loaded? The reason I ask is that I would like to
be able to instantiate my base class object and turn on
remoting at this time. That way, even if the class starts
up as 'Stopped' my service manager app can still get info
back from the service itself. Then the Start command can
actually just start up the timer and do whatever it needs
to do.

Thanks!

Tom

--
 
R

Ronchese

"Tom Simpson" <[email protected]> escreveu na mensagem
I have set up a Windows service in VB.NET, and created a
'Service Manager' Windows Forms app that can 'get'
information from that service. The service consists of the
basic service 'framework' along with a large class that I
wrote that actually does all the work. The Service Manager
app uses .NET remoting to get info into/back from the
service.

I have a couple of questions that I need info on before I
complete this service:

1. When you do a Stop and Start, does the service actually
get unloaded out of memory then reloaded back in? From what
I understood, a service get 'loaded' when the
server/computer starts up, and then is 'started' when the
Start command is issued. However, I saw some comments out
there that seemed to say the service actually gets unloaded
from memory when STOP is called.

2. Is there a way I can tap into when the service actually
first gets loaded? The reason I ask is that I would like to
be able to instantiate my base class object and turn on
remoting at this time. That way, even if the class starts
up as 'Stopped' my service manager app can still get info
back from the service itself. Then the Start command can
actually just start up the timer and do whatever it needs
to do.

Thanks!

Tom

--
 
R

Ronchese

Tom:

About your question 1, the service is totally unloaded when you set it to
stopped. It is a executable with some "tracks" where the system can
recognize as a service, what is executed when your click Start button.

The question 1 responds your question 2, already. :p If the service is
not running and not loaded, your cannot do any taks on your service. The
stuff that is come nearest what you want is the Pause option of the service.

[]s
Cesar




"Tom Simpson" <[email protected]> escreveu na mensagem
I have set up a Windows service in VB.NET, and created a
'Service Manager' Windows Forms app that can 'get'
information from that service. The service consists of the
basic service 'framework' along with a large class that I
wrote that actually does all the work. The Service Manager
app uses .NET remoting to get info into/back from the
service.

I have a couple of questions that I need info on before I
complete this service:

1. When you do a Stop and Start, does the service actually
get unloaded out of memory then reloaded back in? From what
I understood, a service get 'loaded' when the
server/computer starts up, and then is 'started' when the
Start command is issued. However, I saw some comments out
there that seemed to say the service actually gets unloaded
from memory when STOP is called.

2. Is there a way I can tap into when the service actually
first gets loaded? The reason I ask is that I would like to
be able to instantiate my base class object and turn on
remoting at this time. That way, even if the class starts
up as 'Stopped' my service manager app can still get info
back from the service itself. Then the Start command can
actually just start up the timer and do whatever it needs
to do.

Thanks!

Tom

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top