This is a simple Http Sever implemented by Java NIO
also see /code/readme.pdf
- The program structure is depicted below and it uses the reactor pattern.
- Reactor accepts the connection from the client.
- Dispatcher monitors the events and distributes the event to the handler by the threadpool.
- Handler process the request.
- Http parser is a tool to parse the http request.
- After process the request and response, the connection is close.
- The program is based on Java NIO.
- httpserver.jar is the jar file of the server. [ ] means options. The dictionary webroot should be put into the same dictionary with httpserver.jar. Run it : java -jar httpserver.jar serverIP port [NumberOfDispetcher NumOfThreadforEachDispetcher ] E.g. java -jar httpserver.jar 128.178.158.110 8000 4 10 Or just java -jar httpserver.jar 128.178.158.110 8000
- httpclient.jar is to test the server. [ ] means options You can use : java -jar httpclient.jar serverIP port [NumberOfSendingThreads] E.g. java -jar httpclient.jar 128.178.158.110 8000 1000000 Or just java -jar httpclient.jar 128.178.158.110 8000