cjlindstrom
September 9th, 2001, 10:05 AM
I have a weather station on my home that sends weather data out a serial port. I would like to create a server object that will monitor the weather station. All this is easy, what I need is to be able to call that server and get the weather data from any application. Specifically the server will run as a windows NT service and continually monitor the data stream. How do I create the server so that when a client wants data it can communicate with the server and get the data. I wanted to use com, but I can't see how to let a client get the data from the server withought the client creating another instace of the server. I can only have one instance of the server that will allways be running. I hope to just expose some properties of the server to be read by the client. Any ideas how to do this? I don't know quite how to make this inter process communication take place. I don't want to use TCP/IP, I would like it easily callable from asp.
Thanks
Craig
Cakkie
September 10th, 2001, 01:15 AM
Well, i think what you need to do is write the data to a database. This database can then be accessed from ASP, or even better, from a dll that is called from ASP, which is way faster.
First, you will need to determine the format in which you will be writing the data. After that, it's just a matter of getting it out, and showing it.
The getting it out part should be done (as mentioned before) by a dll rather than ASP. This is due to performance issues. Whatever you do, you need to read the data from the database, and output it to the ASP.
What you will be returning is something you must decide, in other words, whatever is suited best for you. Suggestions copuld be HTML, plain text, or XML. If the receiving client is a webbrowser, go for one of the first two. If the client is a custom application, XML could be very handy, since it is quite easy to read XML from an application. Again, this should be something you need to determine yourself.
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook