get rid of the stream parsing that occurs in the Layer III decoder. BitStream.readFra...
[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     } catch (IOException e) {
27       System.err.println(e);
28       System.exit(1);
29     }
30   }
31
32   private void startWorker(Socket client) throws Exception {
33     (new JhttpWorker(client,false,webinterface)).start();
34   }
35
36   public void run() {
37     // infinite loop
38     while (true) {
39       try {
40         startWorker(server.accept());
41       } catch (Exception e) {
42         System.err.println(e);
43       }
44     }
45   }
46 }