I use Twisted Web on an embedded Linux
device to provide browser-based configuration & control. The browser
displays a bar graph of a parameter that is quickly changing on the
embedded device (peak audio level). In order to provide a reasonable
feedback to the user, the browser connects to the Twisted Web CGI server
once a second via XMLHTTPRequest to obtain an updated bar graph level,
then Twisted Web dutifully closes the connection. Is there a way to
achieve the same thing without opening & closing a connection each
time?
My code:
# ----- Set up the web/CGI server to handle browser-based control
-----
from twisted.web import server, static, twcgi
root = static.File("/myResourceDir")
root.putChild("cgi-bin",
twcgi.CGIDirectory("/myResourceDir/cgi-bin"))
reactor.listenTCP(8000, server.Site(root))
Thank you.
_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web