Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have an embedded device running a slimmed down version of a HTTP server. Currently, it can display static HTML pages. Here is an example of how it displays a static HTML page:

char *text="HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"
"<html><body>Hello World!</body></html>";
IPWrite(socket, (uint8*)text, (int)strlen(text));
IPClose(socket);

What I'd like to do is display dynamic content, e.g. a reading from a sensor. What I thought of so far is to have the page refresh every once in awhile with

<meta http-equiv="refresh" content="600">

and use sprintf() to attach the sensor reading to the text variable for the response.

Is there a way I can do this without having to refresh the page constantly?

share|improve this question
    
What web server are you running a "slimmed down version" of? –  Jay Elston Mar 8 '12 at 1:27
    
It's a custom HTTP server written for the Plasma RTOS –  alexb Mar 8 '12 at 2:59
add comment

1 Answer

up vote 0 down vote accepted

You could theoretically implement WebSockets on your server. And have the server fire updates manually. Either that or use long polling. The tough part for you would be implementing either properly. But it could be done.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.