hypercast
Class HTTP_Server

java.lang.Object
  |
  +--hypercast.HTTP_Server

public final class HTTP_Server
extends java.lang.Object


Field Summary
static boolean debug
          Debug flag.
 java.net.ServerSocket serverSocket
          Socket for new connections.
 
Method Summary
 java.net.Socket acceptConnection()
          Accept a connection from the server socket.
static void main(java.lang.String[] args)
          Initializes and starts the web server.
 java.lang.String processQuery(java.util.StringTokenizer queryLineTokens)
          Accepts HTTP requests and passes them to the overlayHandler.
static int purgeQueue(java.util.Vector v, long t)
          Clears the queue of all elements older than 1 second from t.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final boolean debug
Debug flag.

See Also:
Constant Field Values

serverSocket

public java.net.ServerSocket serverSocket
Socket for new connections.

Method Detail

main

public static void main(java.lang.String[] args)
Initializes and starts the web server. The overlayHandler takes care of overlay requests.


acceptConnection

public java.net.Socket acceptConnection()
                                 throws java.io.IOException
Accept a connection from the server socket. For some reason, Java doesn't list accept as a synchronized method.

java.io.IOException

processQuery

public java.lang.String processQuery(java.util.StringTokenizer queryLineTokens)
Accepts HTTP requests and passes them to the overlayHandler.


purgeQueue

public static int purgeQueue(java.util.Vector v,
                             long t)
Clears the queue of all elements older than 1 second from t.

Returns:
the maximum number of elements per second present in queue.