https://github.com/johnib/java-webserver
Multi threaded web server
https://github.com/johnib/java-webserver
Last synced: about 1 year ago
JSON representation
Multi threaded web server
- Host: GitHub
- URL: https://github.com/johnib/java-webserver
- Owner: johnib
- Created: 2015-11-30T18:11:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-11T19:43:36.000Z (over 10 years ago)
- Last Synced: 2025-06-02T17:27:21.129Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 10.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.txt
Awesome Lists containing this project
README
1. These steps will explain how the server works from a higher point of view, less implementation details.
1.0 The main thread listens on the requested port.
1.1 Once connection is accepted, puts it in a queue.
1.2 Returns to step 1.
2. At the other end of the queue, one of the other N threads (of the Thread Pool) pulls a socket from the queue.
Each one of the threads:
2.0 Pulls a socket from the queue.
2.1 Reads the request from socket's input stream.
2.2 Parses the request using regex and creates an Root.HTTPRequest object.
2.3 Creates a response from the parsed Root.HTTPRequest.
2.4 Sends the response to the socket's output stream.
2.5 Returns to step 2.