Get hold of a Service

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

Guest

Hi all,

Ok, here is what I want to do. I want a service to load some data. Then
during the day, several processes will do some stuff with this data. Now, how
can I access the Class behind a running service? Or in other words. How can
my processes access the data loaded by this service?

Any ideas?

Regards Alexander
 
One of the easiest ways would be to use remoting, where on
the server, you end up having the server create a sharable
instance with
RemotingConfiguration.RegisterWellKnownServiceType(), and
then when ever data needs to be updated it connects to it
and makes said changes. On the application side, each one
would simply connect to the same instance and do what ever
they need to do using a similar method.

Take a look at
http://www.csharphelp.com/archives/archive187.html (or
just a general google search) for some info on Remoting.
Given the seeming long life of the data you'll be reading
and the need for it to exist for a while, be sure to
overload InitializeLifetimeService() to return null so
that your remoted object does not timeout.
 
Hum, I thought about this solution, too, but I don't trust Remoting 100% =D.
Am I wrong?

What about performance issues. Is Remoting fast enough? Because this is a
large scaled system, the requests could be very numerous and frequent.
Although these tasks should not consume a lot of working time.

Regards Alexander
 
The best thing I can tell you is to give remoting a try,
see if it is fast enough for you. There is a bit of
overhead to it, but the rewards of using it generally
outweigh the costs.

If you do give it a try, I would recommend using a TCP
port and binary encoding over an HTTP one with SOAP simply
because the prior is faster as there is less running
across the wire.
 
Alexander Wehrli said:
Hum, I thought about this solution, too, but I don't trust Remoting 100%
=D.
Am I wrong?

What about performance issues. Is Remoting fast enough? Because this is a
large scaled system, the requests could be very numerous and frequent.
Although these tasks should not consume a lot of working time.

Regards Alexander


Why not simply use EnterpriseServices (COM+) when you need to call methods
from other processes.
ES offers the fasted interprocess path and is secure, something that cannot
be said of Remoting.
Note that ES components can be configured to run as Services as well (on
W2K3 or XP).

Willy.
 
Sounds interesting! Do you have some links or other references where I could
read something about this? I've never used this before...

Regards Alexander
 
Back
Top