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
Solved

Need to create a service I can talk to

Posted on 2006-11-21
8
223 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
  • 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 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