Results 1 to 3 of 3
  1. #1
    johann_p is offline Member
    Join Date
    Jun 2007
    Posts
    19
    Rep Power
    0

    Question Minimal single threaded web server?

    Is there a library or code samples to implement a minimal, single threaded server for accepting and responding to HTTP GET/POST requests?

    What I want to do is to accept a GET or POST request, run my own code which calculates something and send that back to the client as a response. The server only needs to accept and process one request at a time (the HTTP protocol is just used to make the interaction between a perl-written client and the Java algorithm simpler).

    I wonder what the minimum-effort solution to this is.

  2. #2
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    7

    Default

    Hi Johann,

    This simple implementation from Sun can help you get an idea:
    A Simple Multithreaded Web Server

    You can find there the implementation:
    WebServer.java

    The only problem ... this is multi-threaded :-) but you can change that.
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

  3. #3
    johann_p is offline Member
    Join Date
    Jun 2007
    Posts
    19
    Rep Power
    0

    Default

    Thank you very much - that looks very interesting and and will probably also teach me a few things ;)

Similar Threads

  1. Replies: 0
    Last Post: 04-07-2008, 08:14 PM
  2. how to read single Keystroke without using return
    By oomanamemni in forum New To Java
    Replies: 1
    Last Post: 02-14-2008, 07:21 PM
  3. Compiling a single class
    By ROSOBORONEXPORTCORP in forum New To Java
    Replies: 2
    Last Post: 01-28-2008, 12:27 PM
  4. convert a lot of images into a single one
    By leonard in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 04:47 PM
  5. variable to accept a single object
    By Rgfirefly24 in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 04:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •