"m" <ski...@speakeasy.net> wrote in message
news:qsKcnWTvS41...@speakeasy.net...
> Hello,
> I have been searching for a solid example of using a GUI app to control
and
> monitor a windows service via .net remoting but unfortunately I cannot
find
> anything that is relevant. I will have a windows service that will be
> performing various tasks throughout the day on a schedule, I need a GUI
that
> can change the schedules, add a new task and schedule it, and monitor a
task
> if it is running... The problem is this, I need the service to begin
> processing when it starts up, not when a client connects to it, how can I
> access the data that is in the running service instance?
> Thanks for any and all input!
>
>
"John A" <rocket_...@hotmail.com> wrote in message
news:%23inVxCJ...@TK2MSFTNGP12.phx.gbl...
"m" <ski...@speakeasy.net> wrote in message
news:KKmdnbOeM8z...@speakeasy.net...
"m" <ski...@speakeasy.net> wrote in message
news:YvecnZFbCfM...@speakeasy.net...
Please help.
Rick
"m" <ski...@speakeasy.net> wrote in message
news:YvecnZFbCfM...@speakeasy.net...
"William Stacey" <sta...@mvps.org> wrote in message
news:usP3hTuY...@TK2MSFTNGP09.phx.gbl...
Mike Langley (EDS)
Sr. Systems Analyst/Enginner
>.
>
This is to let those of you searching for a solution to
the GUI being able to get a specific instance of an object
in the Windows Service so you can maintain constant state.
I've succeded in doing this and found the cause of most of
the problems I've encountered. The secret is that in order
for you to get a specific instance you must publish the
created instance of your object by Marshalling it like so;
RemotingConfiguration.Configure
(AppDomain.CurrentDomain.BaseDirectory
+ "VistALink.Server.Listener.exe.config");
_Protocols = new ProtocolStack();
RemotingServices.Marshal((_Protocols), "Protocols");
ProtocolStack is the class I'm trying to publish an
instance of. Once I've created the instance which
populates it in the class constructor, I then Call the
RemotingServices.Marshal() method. This method takes the
actual object you want to publish and the Name you want it
published as. On the client it's very simple to retreave
this object which I configured through my app.config file
like so:
<wellknown
type="Gov.VA.Med.VBECS.VistALink.Server.Protocols.ProtocolS
tack, VistALink.Server.Protocols"
url="tcp://localhost:19800/Protocols"/>
Everything else was as published in a handful of articles.
Unfortunately, I've found that very few articles actually
go through the steps of showing you exactly what this does
and how to configure it.
I long for the days when books were published and the
author felt free to expound till his/her hearts content.
Now, your lucky if you get them to touch on the subject.
Honestly, I'd pay $100 a book if they would explain things
in great detail without filling it full of fluff.
HTH,
Mike Langley (EDS)
Sr. Systems Analyst/Engineer
That is what I assumed. That should not change the server side.
> I could have the remoting
> class handle all of the processing throughout the day, but if I instatiate
> the remoting class in my windows service upon startup, then when a client
> connects the server returns a new server object, not the one that has
> already been created. I guess I could have my windows service run that
...
Option 1) On the server process(es) update Windows Performance counters that
you create.
Then create a remoting singleton that returns these perf
counters.
Option 2) However you launch the server processes does not matter. Create a
singleton that holds its own perf counters (i.e. private fields.) Then have
a public method on that class that returns them. Use remoting on the
download processes to update the singleton as I assume your using seperate
processes and/or application domains?
Option 3) All in one. Create your service. In the service, start the
singleton which clients will call for download perf counter info. Then
handle your downloads for many clients using standard multi-threaded server
design. Use a thread-pool for socket connections or create your own. Many
options and techniques here. Your download threads will call private
methods of your singleton? (I "think" you can create the singleton object
and have a ref to it and then have remoting load *that object - so you
should be able able to call into it privately with your download threads or
your download Manager to update any perf counters.) I like this one the
best I think.
Many other options and variations to the above three ... hth
--William Stacey