473,748 Members | 6,161 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb.NET Front-End/Windows Service Communication.. .

I have an application model which will consist of a front-end
configuration application, which needs to control the state of a
back-end vb.net windows service (which is the component that does all
the work). Think of this in the same manner as say microsoft management
console and the w3svc (inetinfo) service.

What should the standard communication protocol be between the
configuration app and the service in this model?

For example, If I'm using the configuration app, and I click a button to
tell the service to do some action, what means of communication should I
use. Obviously, with .net, COM is not the way to go. Writing an XML
file, and having the service poll for changes in the xml file seems
hokey. So, I guess I'm looking for the proper way to handle this.

Any info you can provide would be appreciated...

Thanks,
Brian

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #1
5 8472
Brian,
The easiest way to have a service accept a "command" to do something is to
override the ServiceBase.OnC ustomCommand method and have it call the same
procedure your Timer.Elapsed event handler calls.

Then you can use ServiceControll er.ExecuteComma nd to invoke this custom
command.

Note I would probably define an Enum of CustomCommands that my service
supported so its easier to keep track of them. A custom command for
OnCustomCommand is an integer between 128 & 256, which also means you can
have multiple custom commands defined.

Remember that ServiceControll er can control services on your local machine
as well as services on remote machines. Note you may need to configure the
various machines to allow remote control of services.

An alternative, more flexible method, which also entails more work, is to
enable your service for .NET Remoting. You could either make it a .NET
Remoting Server, in which case you call a method to have it perform some
action, or a .NET Remoting Client, and possible handle an "update data
event" on your server remoting object that says to update data...

Both of the custom commands & remoting with a service are discussed in
Matthew MacDonalds book "Microsoft Visual Basic .NET Programmer's Cookbook"
from MS Press.

Hope this helps
Jay
"Brian Patrick" <bp*********@ho tmail.com> wrote in message
news:uq******** ******@TK2MSFTN GP15.phx.gbl...
I have an application model which will consist of a front-end
configuration application, which needs to control the state of a
back-end vb.net windows service (which is the component that does all
the work). Think of this in the same manner as say microsoft management
console and the w3svc (inetinfo) service.

What should the standard communication protocol be between the
configuration app and the service in this model?

For example, If I'm using the configuration app, and I click a button to
tell the service to do some action, what means of communication should I
use. Obviously, with .net, COM is not the way to go. Writing an XML
file, and having the service poll for changes in the xml file seems
hokey. So, I guess I'm looking for the proper way to handle this.

Any info you can provide would be appreciated...

Thanks,
Brian

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 21 '05 #2
Jay - thanks for the reply. I have a question for you...

If using your ExecuteCommand idea, how would I pass parameters to the
service from the front-end app? It sound's like you mean I could just tell
the service to run one of a possible 128 commands, but not be able to pass
data along. Let me know if I'm incorrect...

Thanks,
Brian

"Jay B. Harlow [MVP - Outlook]" wrote:
Brian,
The easiest way to have a service accept a "command" to do something is to
override the ServiceBase.OnC ustomCommand method and have it call the same
procedure your Timer.Elapsed event handler calls.

Then you can use ServiceControll er.ExecuteComma nd to invoke this custom
command.

Note I would probably define an Enum of CustomCommands that my service
supported so its easier to keep track of them. A custom command for
OnCustomCommand is an integer between 128 & 256, which also means you can
have multiple custom commands defined.

Remember that ServiceControll er can control services on your local machine
as well as services on remote machines. Note you may need to configure the
various machines to allow remote control of services.

An alternative, more flexible method, which also entails more work, is to
enable your service for .NET Remoting. You could either make it a .NET
Remoting Server, in which case you call a method to have it perform some
action, or a .NET Remoting Client, and possible handle an "update data
event" on your server remoting object that says to update data...

Both of the custom commands & remoting with a service are discussed in
Matthew MacDonalds book "Microsoft Visual Basic .NET Programmer's Cookbook"
from MS Press.

Hope this helps
Jay
"Brian Patrick" <bp*********@ho tmail.com> wrote in message
news:uq******** ******@TK2MSFTN GP15.phx.gbl...
I have an application model which will consist of a front-end
configuration application, which needs to control the state of a
back-end vb.net windows service (which is the component that does all
the work). Think of this in the same manner as say microsoft management
console and the w3svc (inetinfo) service.

What should the standard communication protocol be between the
configuration app and the service in this model?

For example, If I'm using the configuration app, and I click a button to
tell the service to do some action, what means of communication should I
use. Obviously, with .net, COM is not the way to go. Writing an XML
file, and having the service poll for changes in the xml file seems
hokey. So, I guess I'm looking for the proper way to handle this.

Any info you can provide would be appreciated...

Thanks,
Brian

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 21 '05 #3
Brian,
You are correct ExecuteCommand only allows you to run one of a possible 128
commands, no parameters.

If you need parameters, I would recommend the .NET Remoting solution.

As an alternative, depending on the nature of the parameters, I would
consider writing them to the Service's app.config file, then stopping &
restarting the service. If your service only has a single service in it,
stopping it causes it to be unloaded from memory, restarting it should then
cause it to re-read its app.config. Of course if you service reads its
config from the registry or a different file, then you may not need to stop
& restart it.

Hope this helps
Jay

"bpatrick10 0" <bp*********@di scussions.micro soft.com> wrote in message
news:D3******** *************** ***********@mic rosoft.com...
Jay - thanks for the reply. I have a question for you...

If using your ExecuteCommand idea, how would I pass parameters to the
service from the front-end app? It sound's like you mean I could just
tell
the service to run one of a possible 128 commands, but not be able to pass
data along. Let me know if I'm incorrect...

Thanks,
Brian

"Jay B. Harlow [MVP - Outlook]" wrote:
Brian,
The easiest way to have a service accept a "command" to do something is
to
override the ServiceBase.OnC ustomCommand method and have it call the same
procedure your Timer.Elapsed event handler calls.

Then you can use ServiceControll er.ExecuteComma nd to invoke this custom
command.

Note I would probably define an Enum of CustomCommands that my service
supported so its easier to keep track of them. A custom command for
OnCustomCommand is an integer between 128 & 256, which also means you
can
have multiple custom commands defined.

Remember that ServiceControll er can control services on your local
machine
as well as services on remote machines. Note you may need to configure
the
various machines to allow remote control of services.

An alternative, more flexible method, which also entails more work, is to
enable your service for .NET Remoting. You could either make it a .NET
Remoting Server, in which case you call a method to have it perform some
action, or a .NET Remoting Client, and possible handle an "update data
event" on your server remoting object that says to update data...

Both of the custom commands & remoting with a service are discussed in
Matthew MacDonalds book "Microsoft Visual Basic .NET Programmer's
Cookbook"
from MS Press.

Hope this helps
Jay
"Brian Patrick" <bp*********@ho tmail.com> wrote in message
news:uq******** ******@TK2MSFTN GP15.phx.gbl...
>I have an application model which will consist of a front-end
> configuration application, which needs to control the state of a
> back-end vb.net windows service (which is the component that does all
> the work). Think of this in the same manner as say microsoft
> management
> console and the w3svc (inetinfo) service.
>
> What should the standard communication protocol be between the
> configuration app and the service in this model?
>
> For example, If I'm using the configuration app, and I click a button
> to
> tell the service to do some action, what means of communication should
> I
> use. Obviously, with .net, COM is not the way to go. Writing an XML
> file, and having the service poll for changes in the xml file seems
> hokey. So, I guess I'm looking for the proper way to handle this.
>
> Any info you can provide would be appreciated...
>
> Thanks,
> Brian
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!


Nov 21 '05 #4

"Brian Patrick" <bp*********@ho tmail.com> wrote in message
news:uq******** ******@TK2MSFTN GP15.phx.gbl...
I have an application model which will consist of a front-end
configuration application, which needs to control the state of a
back-end vb.net windows service (which is the component that does all
the work). Think of this in the same manner as say microsoft management
console and the w3svc (inetinfo) service.

What should the standard communication protocol be between the
configuration app and the service in this model?


I've been planning on doing this myself and I was told that Remoting is the
way to go.
Nov 21 '05 #5
Thanks guys - I'll have to look into .net remoting then. Do you know of any
*working* sample projects that are downloadble from the web?

Thanks,
Brian

"Jeff Johnson [MVP:VB]" wrote:

"Brian Patrick" <bp*********@ho tmail.com> wrote in message
news:uq******** ******@TK2MSFTN GP15.phx.gbl...
I have an application model which will consist of a front-end
configuration application, which needs to control the state of a
back-end vb.net windows service (which is the component that does all
the work). Think of this in the same manner as say microsoft management
console and the w3svc (inetinfo) service.

What should the standard communication protocol be between the
configuration app and the service in this model?


I've been planning on doing this myself and I was told that Remoting is the
way to go.

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
5311
by: Digital Puer | last post by:
Hi, suppose I have an unsigned long long. I would like to extract the front 'n' bits of this value and convert them into an integer. For example, if I extract the first 3 bits, I would get an int between 0 and 7 (=2^3-1). Could someone please help out? I can assume the largest returned value fits in an int. Also, I'm on a big-endian PPC (AIX), in case that matters. Ideally, I'd like to implement a prototype like: int...
1
2199
by: NGM | last post by:
Hello All When implementing FrontController sample MSDN I am facing a lot of problems try implementing the front controller patterm sample provided by microsoft: (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp) The irony of microsoft asp.net sample is it does not work...and the WORKAROUND as they say it is provide in article...
2
1943
by: Alok Jain | last post by:
Hi, We are using Front Controller implementation in our DotNet application. I am trying to hide URL in my application. This is based on Front Controller model. I am able to achieve if I do not use postback in ASP.Net control. If I post back from a ASP.Net control it takes me to the correct page and the URL is displaeyd as it is.
3
2453
by: Ashish | last post by:
Is anyone aware of a good Front Controller Pattern implementation in ASP.Net, we are developing a new product, and contemplating whether we should use Front Controller Pattern implementation, due to the flexiblity it provides for navigation and loading views etc.... any pointers/comments would be appreciated. regards -ashish
7
2099
by: Abhishek Saksena | last post by:
Hi all, Can somebody help me what the bhaviour of front method on an empty map. For some reason calling front on an empty map seems to work with gcc compiler but not with .NET. Abhishek
6
2685
by: eight02645999 | last post by:
hi wish to ask a qns on strip i wish to strip all spaces in front of a line (in text file) f = open("textfile","rU") while (1): line = f.readline().strip() if line == '': break print line
3
4780
by: M O J O | last post by:
Hi, I have an application where I've implemented a global hotkey, so no matter what other application is in front (have focus), my app will react when the key combination is pressed. This works fine. My problem is now that the form I want to show, does not come to the front. I've tried to set Topmost to true, but then the form doesn't recieve focus.
5
24981
by: Iain Bishop | last post by:
I have a simple form with 4 command buttons and 1 label. The label is sometimes visible and sometimes not. When it is visible I want it to be in front of the buttons. I've tried bringing the label to the front and sending the buttons to the back. In design view the form looks fine, but whenever I open the form the label is behind the buttons. Has anyone else experienced this and know the solution? Is this a known fault? I wouldn't think...
3
6919
by: John | last post by:
What is the easiest way to make the contact form show on the front page. Meaning on want to keep the front html page and when someone clicks on the contact us link the front page remains the same, but there is a contact form in the middle of the page. Any help would be appreciated. - John
2
4071
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I asked here yesterday about bringing a form to front with hotkey while using different application then mine (meaning, when i'm using outlook, and pressing ALT+T it will bring a form from my application to front), my problem was that after i press the hotkey, the window stays in minimize state instead of being in the front. i fount an article in google explaining (i think) how to solve this problem, but i couldn't understand what...
0
8828
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.