Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Windows Service with GUI Config/Monitor Tool via Remoting

8 views
Skip to first unread message

John A

unread,
Aug 12, 2003, 1:15:01 AM8/12/03
to
What data is in the service? Where does it get it from? How do you want to
process it? Is the service processing the data?

"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!
>
>


m

unread,
Aug 12, 2003, 7:59:09 PM8/12/03
to
The service will be downloading and processing files, the GUI needs to be
able to see its current progress on the current running task in the service
and various other information such as the task name, schedule, etc.. It also
needs to be able to see all available tasks that will run throughout the
day, be able to add a scheduled task, etc.. I need to access variables and
methods within the running instance of the server. The service will run
autonomously w/o the GUI, the GUI is only for occasional monitoring or
configuring of the service. I do not want to create a new server object, I
need to get a reference to one that already exists on the server(service) so
that I can have interaction between my service and the GUI... I hope this is
clear, thanks!

"John A" <rocket_...@hotmail.com> wrote in message
news:%23inVxCJ...@TK2MSFTNGP12.phx.gbl...

m

unread,
Aug 14, 2003, 3:51:18 AM8/14/03
to
Someone must be using .NET remoting to pass variable values between two
running applications... For instance, say I have two windows form apps, one
that is processing a file and the other that displays the progress % of the
process in the other app. How is this achieved? People say it is possible,
but I have yet to see a working code example or a tutorial or anything like
that.. Please help me :)

"m" <ski...@speakeasy.net> wrote in message

news:KKmdnbOeM8z...@speakeasy.net...

William Stacey

unread,
Aug 15, 2003, 12:22:27 AM8/15/03
to
Many ways to do this. I might do this: On the server, have a remoting
method to do the file transfer, etc. Within that method, update a private
var in the server object with the file progress. Have another method that
just returns the file progress var that other clients can call. If your
allowing multiple file transfers at the same time, then you will need to use
an array of objects (or other) to store the state of each file trans
progress. hth
--wjs

"m" <ski...@speakeasy.net> wrote in message

news:YvecnZFbCfM...@speakeasy.net...

Rick Nunes

unread,
Aug 15, 2003, 7:18:41 PM8/15/03
to
I am in the same boat. I want to have two Windows Form application talk to
each other, but I have yet to find an example. All the examples I have found
will output to the Console but not to another form.

Please help.
Rick

"m" <ski...@speakeasy.net> wrote in message

news:YvecnZFbCfM...@speakeasy.net...

m

unread,
Aug 16, 2003, 7:38:02 AM8/16/03
to
Thanks for the reply William,
The thing is, the server(service) will be running processes throughout the
day that are completely independent of the client. 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
processes the files and have it connect to another windows service remoting
host(singleton object) that merely stores information on the current process
and then connect to the intermediate remoting host service from my windows
GUI to retrieve the values and also pass commands that the processing
service through the singleton remoting host that would be retrieved every
few seconds by the processing service. It just doesn't seem like a clean way
to do it though, I would prefer to keep it all within one service just to
K.I.S.S. The intermediate remoting host would introduce more lag in the
response to commands from the GUI app as well. I have looked in a ton of
remoting books and cannot find any relevant examples for my needs. The fact
that I am using services is irrelevant, I just want to see 2 apps
communicate information back and forth, with the client being able to
connect to a server object that has already been instantiated by the main
class in the server app when it initially loads(before any clients attempt
to connect to it). Is anyone using a server in this manner? I have a few
ideas I'm going to try tonight :)
Thanks!


"William Stacey" <sta...@mvps.org> wrote in message
news:usP3hTuY...@TK2MSFTNGP09.phx.gbl...

Mike Langley

unread,
Aug 18, 2003, 9:59:15 AM8/18/03
to
I'm in the same boat. I have a Server which uses plugable
protocols via a standard interface. When the service
starts it creates an instance of a custom
NameObjectCollection called ProtocolStack which inherets
from MarshalByRefObject since I just want a reference to
the object instead of a copy. I want to be able to use
events to be able to monitor the running progress of the
Server as it processes calls for any protocol that may be
registered. I started using HTTPChannels but abandoned it
when all attempts only yelded an empty object with no
Protocols in the NameObjectCollection. I then looked at
using WMI but the learning curve was much more than the
actual time I have for implementation. I'm now relooking
at remoting in hopes that this will eventually yeild the
promised results. I've seen several posts in several
places where Ingo Rammer has stated that this is possible
but so far all attempts have been in futility. So far,
from my experience, remoting has been a very flakey
technology which requires many little tweeks here and
there. I've now purchased Rammer's and Microsoft's .NET
Remoting books in hopes to aleviate my Remoting headaches.
If I can get this working I'll be glad to send out an
example of my finished works. Keep your fingers crossed.

Mike Langley (EDS)
Sr. Systems Analyst/Enginner

>.
>

Mike Langley

unread,
Aug 18, 2003, 1:45:34 PM8/18/03
to
I previously posted a reply way down in the thread but
figured I'd post up on the top here.

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

William Stacey

unread,
Aug 18, 2003, 7:33:30 PM8/18/03
to
> The thing is, the server(service) will be running processes throughout the
> day that are completely independent of the client.

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


0 new messages