tags:

views:

29

answers:

1

Hello,

I'm making a little application which will control a sort of a hardware indicator thingie (usable as a volume indicator, processor load meter and such).

My goal is to make the device accessible to other applications as easily as possible. What would be the best approach to go about this? I was thinking making a "web" service on the local host using a small server applicatoin. An application would access the device in such a way as "127.0.0.1:23456/foo?par1=123?par2=456" etc. The server would then parse the input. The server would be a sort of middle man (the device communicates with the PC via an USB serial port).

Is this the proper way of doing this, or is there a better way of doing this?

Thanks,

David PS: This is my first post here. So I'm sorry for anything I may have omitted.

+1  A: 

The 'application' you describe sounds more like a Control. In which case, pack it in an assembly that the other project(s) can include.

If you do want it to run as a service, the appropriate choice would be WCF. That will let you communicate over HTTP, TCP or IPC protocols as the situation requires. Without changing your service.

Henk Holterman
Thanks!I forgot to mention that the device should be accessible to more apps at the same time. There are more indicators on it. Making it a "Control" would restrict the COM port to one single application. The point of the webservice was to have the server have the COM port opened constantly and allow others to access it. Thanks for the WCF recommendation, I'll look into it.
daqq
yup, WCF with the netNamedPipeBinding sounds like a perfect match here
marc_s