These three snippets can be used to run a server from sunfire that can accept a connection from an applet served there.. It will sound a bit convoluted but is actually rather straightforward. To begin with you need to think about the unix file system in which files may be transparently mounted on other machines.. In fact those files in "your_home/public/html" are available transparently to starfire (www2). This code is:

cgi_driver.html When this webpage is served from starfire by www2 you can use it to initiate cgi scripts for starting or stopping a server run on starfire. Because starfire is the machine on which your server process is running, an applet served from one of your pages is allowed to make a connection to it.

start.cgi The start script is a Bourne shell (sh) script which kicks off the server by running the java interpreter on the server class file. Getting the process id is an important step because you'll need it later to kill the process. Under solaris kills do not occur immediately and do not provide feedback to stdout. Because you are flying blind with a process on an "inaccessible" machine, it is important that you kill your server & wait a prudent interval before setting a new one back up..

stop.cgi The stop script cats the process id from the cookie file, terminates the server with extreme prejudice (-9) and then deletes the cookie file & exit