Change tabbing for everything....
[IRC.git] / Robust / src / Interface / JhttpServer.java
1 package Interface;
2
3 //****************************************************************************
4 // Programmer: Duane M. Gran, ragnar@cs.bsu.edu
5 // Program:    JhttpServer
6 // Date:       April 24, 1998
7 //****************************************************************************
8
9 import java.net.*;
10 import java.io.*;
11
12 public class JhttpServer extends Thread {
13
14   private ServerSocket server;
15   private WebInterface webinterface;
16
17 //****************************************************************************
18 // Constructor: JhttpServer(int)
19 //****************************************************************************
20   public JhttpServer(int port, WebInterface webinterface) {
21     System.out.println("starting...");
22     this.webinterface=webinterface;
23     try{
24       System.out.println("creating the port");
25       server = new ServerSocket(port);
26     }
27     catch (IOException e){
28       System.err.println(e);
29       System.exit(1);
30     }
31   }
32
33   private void startWorker(Socket client) throws Exception {
34     (new JhttpWorker(client,false,webinterface)).start();
35   }
36
37   public void run() {
38     // infinite loop
39     while (true){
40       try{
41         startWorker(server.accept());
42       }
43       catch (Exception e){
44         System.err.println(e);
45       }
46     }
47   }
48 }