412 Project 3
Loading...
Searching...
No Matches
WebServer.h
1#ifndef WEBSERVER_H
2#define WEBSERVER_H
3
4#include "Request.h"
5
12class WebServer {
13public:
17 bool busy;
18
19 WebServer();
20 void create_request(Request& request);
21 void process_request(int time);
22 void finish_request();
23};
24
25#endif
The WebServer class simulates a server that processes network requests.
Definition WebServer.h:12
void finish_request()
Marks the current request as finished and sets the server to idle.
Definition WebServer.cpp:54
Request curr_request
The current request being processed by the server.
Definition WebServer.h:14
bool busy
Indicates whether the server is currently busy.
Definition WebServer.h:17
void process_request(int time)
Processes the current request for the specified time.
Definition WebServer.cpp:35
void create_request(Request &request)
Assigns a request to the server and marks it as busy.
Definition WebServer.cpp:17
int time_left
The remaining time to finish the current request.
Definition WebServer.h:15
WebServer()
Constructs a new WebServer object.
Definition WebServer.cpp:9
int time_idle
The amount of time the server has been idle.
Definition WebServer.h:16
The Request struct represents a network request with incoming and outgoing IPs, a time duration for p...
Definition Request.h:13