- There are 2 programs
- PART 1 - webserver1.cpp is a Single-threaded web server written in C++.
- PART 3 - webserver2.cpp is a Multi-threaded web server written in C++.
- The server listens on a specified port 52837, accepts incoming client connections, and serves HTML and PDF files to clients.
- Each client connection is handled in a separate thread in the webserver3.cpp program, allowing the server to handle multiple client requests concurrently.
- The server parses incoming HTTP requests, retrieves requested files, and sends HTTP responses, supporting basic web server functionalities.
- The server supports only "GET" request method and HTML and PDF file type.
- The servers were tested and handles upto 500MB PDF File transfers.
- The service was denied on repeated request to the server for large PDF Files (500MB).
- Multithreading is implemented with pthread to support all versions of C++. "thread" is compatible only after C++ 11
- The servers were tested with 10MB, 50MB, 100MB and 500MB PDF File size.
- The servers were tested through client requests in the same network.
- If the client denies the response (cancels PDF download) the server raises error and is terminated.
- Can switch to "DEBUG" mode to analyse the program flow. (to switch set const bool DEBUG = true;)
- Client-Server chat in C++ using sockets by KARIM OUMGHAR
- TCP File Transfer
- GeeksForGeeks Socket Programming
- POSIX thread
- Pros and Cons of pthreads versus C11 threads
- Multithreading Best Practices
- convert values between host and network byte order
- 10,50,100 MB PDF Test Files
- 500 MB PDF Test File
- Download the folder
- Open command line/ terminal.
- To run Single threaded web server
- Execute the below commands
-
g++ webserver1.cpp -o server ./server
- OR
-
g++ webserver1.cpp -o server; ./server
- Request the following files using the URLs through a browser(client)
- To run Multi-threaded web server
- Execute the below commands
-
g++ webserver2.cpp -o server ./server
- OR
-
g++ webserver2.cpp -o server; ./server
- Request the following files using the URLs through a browser(client)
I have done this assignment completely on my own. I have not copied it, nor have I given my solution to anyone else. I understand that if I am involved in plagiarism or cheating I will have to sign an official form that I have cheated and that this form will be stored in my official university record. I also understand that I will receive a grade of "0" for the involved assignment and my grade will be reduced by one level (e.g., from "A" to "A-" or from "B+" to "B") for my first offense, and that I will receive a grade of "F" for the course for any additional offense of any kind.
By signing my name below and submitting the project, I confirm the above statement is true and that I have followed the course guidelines and policies.
Submission date: 11 OCTOBER 2023
Team member 1 name: VENKATNARAYAN GNANAGURUPARAN
Team member 2 name (N/A, if not applicable): Sowmya Achu