Alertd Monitor test applet

This is a simple test applet which uses a couple of new classes I've been working on. When you click on the button below, a new instance of the AlertdMon class is created. This starts up two threads, one to respond to events, like button clicks, and one to update the display. Creating a thread for each task that the applet nedds to do allows it to keep running after the browser unloads the applet's page and calls the stop() method. The thread that updates the display uses a subclass of FifoRdr to get data from the server. This server has alertd running as well as test program that just randomly sends alerts. The FifoRdr class communicates with a cgi script called nph-fifordr, which creates a fifo and then sits on it waiting for data to appear. In this case the fifo is something that alertd knows to check for and if it is present, write alerts to it. While there is no data in the fifo, nph-fifordr sends out "ticks". The ticks are just integer zeros. The FifoRdr class responds by calling its abstract OnIdle() method. In this derivatve of FifoRdr (ADMonRdr) all that OnIdle does is update the tick counter. When a FifoRdr object gets data from nph-fifordr, it calls its abstract method OnData(), which in this case is a function that reads an alert message from the input stream and displays it in a list box.

the applet would be here if it were

note: netscape 3's security manager doesn't want to let me call suspend() on a thread, so "pause" doesn't work with it. HotJava, MSIE, and Netscape 4 all work, however

This method demonstrates the model of using server push to achieve dynamically updated applets. Unfortunately any sort of buffering that occurs in between the applet and the cgi script invalidates this method. With normal httpd/cgi implementations this is easy to do with nph scripts and either using fflush() or setvbuf() to control the buffering. I am afraid the with ssl servers, however, there is no way that we can get this type of control. My initial tests with httpd1.4.2/SSLeay confirm this.

alternatives

Anyone have ideas about how to proceed?