/* basicweb.BaseServer.java
* $Id, $Date eric Exp $
* (c) COPYRIGHT MIT and INRIA, 1997.
* Please first read the full copyright statement in file COPYRIGHT.html
*
* Caution: emits shower of sparks.
*/
package w3c.model.tools.basicweb;
import java.io.*;
import java.net.*;
import w3c.model.www.pep.PEPAgent;
import w3c.model.www.pep.altlib.*;
abstract public class BaseServer extends Agent
private ServerSocket serverSocket = null;
public final static int CONTINUE = 1; /* maintain possible persistent connection */
public final static int ERROR = 2; /* eat up remainder of input */
public final static int DONE = 3; /* go back to accept */
public final static int EXIT = 4; /* tell server to shut down */
public final static String prop_SERVER_ROOT = "server.root";
private final static int DEFAULT_PORT = 8888;
int port;
BaseServer ( intport) {
super();
this.port = port;
}
void serve () throws IOException{
serverSocket = ServerSocket(port);
intstatus = CONTINUE;
do {
try {
Socketsocket = serverSocket.accept();
/*