|
412 Project 3
|
The Request struct represents a network request with incoming and outgoing IPs, a time duration for processing, and (optionally) a job type. More...
#include <Request.h>
Public Member Functions | |
| Request () | |
| Constructs a new Request object. | |
| Request (std::string ip_in, std::string ip_out, int time, char job_type) | |
| std::string | create_ip () |
| Generates a random IP address in the format XXX.XXX.XXX.XXX. | |
The Request struct represents a network request with incoming and outgoing IPs, a time duration for processing, and (optionally) a job type.
This struct is used by the LoadBalancer to queue and assign tasks to WebServers.
| Request::Request | ( | ) |
Constructs a new Request object.
Generates random incoming (ip_in) and outgoing (ip_out) IP addresses and assigns a random time (between 1 and 100) for processing the request.
| std::string Request::create_ip | ( | ) |
Generates a random IP address in the format XXX.XXX.XXX.XXX.
Each segment of the IP address is a randomly generated integer between 0 and 255.