Defines the WebServer class that processes requests assigned by the LoadBalancer.
int id
Unique identifier for this server.
~WebServer()
Destructor. Cleans up any assigned request to prevent memory leaks.
const bool tick()
Advances the server by one clock cycle.
WebServer(int id)
Constructs a WebServer with the given ID.
int cyclesRemaining
Clock cycles remaining to finish the current request.
void assignRequest(Request *req)
Assigns a new request to this server for processing.
int getId()
Returns the server's unique ID.
Request * currRequest
Pointer to the currently assigned request, or nullptr if idle.
Represents a single network request with source/destination IPs, processing time, and job type.
int time
Processing time in clock cycles.