Solved

Need to create a service I can talk to

Posted on 2006-11-21
8
229 Views
Last Modified: 2010-04-23
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)?
0
Comment
Question by:klamerus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 13

Accepted Solution

by:
newyuppie earned 500 total points
ID: 17986716
in the 101 vb samples from MSDN there is one example called "Advanced Remoting - How to TCP Remoting". i think that's what you are looking for

http://www.microsoft.com/downloads/details.aspx?familyid=08e3d5f8-033d-420b-a3b1-3074505c03f3&displaylang=en
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17986898
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.
0
 
LVL 1

Author Comment

by:klamerus
ID: 17987254
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
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:klamerus
ID: 17987304
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?
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17987351
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 ?
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17987878
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.
0
 
LVL 1

Author Comment

by:klamerus
ID: 17992421
Excellent.  Anyway advice on which is preferred over the other?  Are there advantages one way vs. another?
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17992943
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.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question