Link to home
Start Free TrialLog in
Avatar of AlphaLolz
AlphaLolzFlag for United States of America

asked on

Need to create a service I can talk to

I need to create a service in VB.Net that I can interact with.

We need to have a service running on a server and we need to be able to modify it's behavior.  In particular, we're going to have the service start-stop slave processes when we tell it to.

We really want to do this remotely, so we'll eventually wrap this with a web front-end (I imagine).  In the meantime, we don't know of a good way to talking to this process in the first place.  We'd like to start with a test app, that we can command and just have it generate a test file out that verifies it got the message.

How would you do this (short of having it poll for a command file or something)?
ASKER CERTIFIED SOLUTION
Avatar of newyuppie
newyuppie
Flag of Ecuador image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kinger247
Kinger247

If all you need to do is administer other services, I think you need to look into web services or ASP as apposed to tcp remoting.
It would be allot simpler. The WS/ASP page could handle all the starting and stopping of other services.

First thing, look into creating an module to start/stop local/remote services (on the same network internally).
Secondly, create a web service or asp page, that can access the above module to start/stop services.

As newyuppie stated ealrier, there are loads of examples to use on the web so I won't pass any code here.
But I think if you start with the 2 modules above you won't go wrong.
Avatar of AlphaLolz

ASKER

I'm thinking remoting might be what I need.

What I want to remotely manage is not other services.  The working processes I'm talking about would be a set of threads.  Each of these threads performs work.  We want to be able to tell the "control" process (the windows service) to start additional worker threads if things are getting behind, or to remove threads or even pause work temporarily (while we do something on another system).

So, we need a windows service (written in .Net, preferably VB.NET), that will manage these threads.  We want to be able to tell that master process to add/remove working threads when we think more processing is needed.

We want to do this from a desktop to start.  Right now we need to log on to the server to start and stop processes manually.  That introduces risk.

Mark
Maybe I don't even need "real" remoting.  If the master windows service can listen to a TCP/IP port as well and we can have it response to requests on that while it's controlling the other applications, then we could send it commands.

Is this possible?
That is possible.
when you talk of remote access (to make sure we're on the same page) your talking about via the internet ?  or just another machine ?
there are as you may have noticed several methods. if you would like to listen on a defined port and send commands to it, its a perfectly good approach. the example you need is in the link i provided as well, and its called: "Advanced .NET Framework (Networking) - Use Sockets"

the example is simple enough and if you modify a bit you could even use that one.
Excellent.  Anyway advice on which is preferred over the other?  Are there advantages one way vs. another?
remoting seems a little harder at first glance, but they both can do the job. as for advantages of one way over the other, someone correct me if im wrong but i guess the new remoting classes in 2.0 are capable of more security in the transmission of data.