What is the preferred method of passing data between a service and an application [duplicate]
Possible Duplicate:
Delphi 2009: How to communicate betw开发者_StackOverflow中文版een Windows service & desktop application under Vista?
I have a server running as a Windows service. To control the service and to display it's state I have an application running as a tray icon. I would like to pass data (log strings) from the service to the application.
What's the best way to do this?
The best approach here is IPC based on Named Pipes. TCP/IP is also a very good solution but it is slower than Named Pipes. Named Pipes also work over computer in a LAN.
You can use my implementation which is packet oriented and hides all technical details from you. Download is available at: http://www.cromis.net/blog/downloads/cromis-ipc
There are many options for interprocess communication. http://en.wikipedia.org/wiki/Inter-process_communication
I tend to use sockets, with HTTP and HTML. This way I may use a browser to control my service. Even remotely.
Use any kind of SOAP implementation, it shoudl be flexible enough to provide you with certain extensibility for the future and to provide you with the ability to connect from other location/applications.
Webservices are a good option.
精彩评论