Class SimpleHttpServer


  • public class SimpleHttpServer
    extends java.lang.Object
    A basic HTTP server that merely echoes the path and the query string supplied to it in a GET request Usage: Run java kilim.examples.HttpFileServer [base directory name] From a browser, try "http://localhost:7262/hello", "http://localhost:7262/buy?code=200&desc=Rolls%20Royce">" SimpleHttpSession is an HTTPSession task, itself a thin wrapper over the socket connection. An instance of this task is launched for each new connection, and its execute method is called when the task is scheduled.

    The HttpRequest and HttpResponse objects are wrappers over a bytebuffer, and unrelated to the socket. The request object is "filled in" by HttpSession.readRequest() and the response object is sent by HttpSession.sendResponse().

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleHttpServer

        public SimpleHttpServer()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Throws:
        java.io.IOException