Bredbandskollen CLI  1.2
Asynchronous network task engine
latencytask.h
1 #pragma once
2 
3 #include <vector>
4 #include "measurementtask.h"
5 
6 class LatencyTask : public MeasurementTask {
7 public:
8  LatencyTask(const std::string &ticket, const HttpHost &server);
9  void newRequest(HttpClientConnection *) override;
10  bool requestComplete(HttpClientConnection *conn) override;
11 private:
12  std::vector<double> samples;
13  // Maps expected response to start time of request:
14  std::map<std::string, TimePoint> current_request;
15  unsigned int serial_no = static_cast<unsigned int>(rand());
16 };
HTTP/1.1 client protocol.
Definition: httpclientconnection.h:39
The host name and port number of a HTTP host.
Definition: httphost.h:17
Definition: latencytask.h:6
void newRequest(HttpClientConnection *) override
Initiate next request, or ignore to close connection.
Definition: latencytask.cpp:9
bool requestComplete(HttpClientConnection *conn) override
Called when response has been fully read.
Definition: latencytask.cpp:15
Definition: measurementtask.h:9