Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2005

Tip: Looking for answers? Try searching our database.

How to raise an event from my windows application to my windows service?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Filipe Marcelino - 21 Sep 2005 12:24 GMT
Hi,

I'm an experienced vb .net developer in windows forma. Now I'm trying
to develop a windows service and I would like to know if it's possible
to raise an event from a windows application developed by me to a
windows service developed by me. I would like to do something like,
when a user changes something inmy application I would like to fire an
event to my windows service and make a log. Is this possible?

If I'm not clear please make me know.

Regards,
Filipe Marcelino
Cowboy (Gregory A. Beamer) - MVP - 21 Sep 2005 13:19 GMT
There are a couple of ways to tackle this.

1. Create a windows service that has a listener and leave it running
2. Create a web service, either through ASMX (bound to a "web app") or
Remoting

In the second instance, the guts of the listener are already configured for
you, esp. in the case of the ASMX service. To fire off to this type of
service, you send a message through a TCP socket.

If you go this route, Remoting will perform better as it is not tied to the
HTTP stack. There are also plenty of examples in remoting, showing how to set
up both "server" (the listening service) and "client" (your application).

If you go the other route, you will have to configure the plumbing yourself,
although the Remoting samples, along with a peak at the Remoting core (with
ILDASM or, preferably, Lutz Roeder's Reflector with teh File Dissassembler
plug in), will help you.

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

> Hi,
>
[quoted text clipped - 9 lines]
> Regards,
> Filipe Marcelino
Richard Blewett [DevelopMentor] - 21 Sep 2005 14:16 GMT
Use remoting. Have the sevice expose a remoting endpoint (wellknown singleton maybe) and connect to it from the windows application. The application can then notify the service when "interesting" things happen. If you are using .NET 2.0 you can use the IPC channel which saves you opening a port on the machine.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

  Hi,

I'm an experienced vb .net developer in windows forma. Now I'm trying
to develop a windows service and I would like to know if it's possible
to raise an event from a windows application developed by me to a
windows service developed by me. I would like to do something like,
when a user changes something inmy application I would like to fire an
event to my windows service and make a log. Is this possible?

If I'm not clear please make me know.

Regards,
Filipe Marcelino

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.