Change the connected time from time_t to timespec.
[cubemap] / client.h
index d23b860..4e80031 100644 (file)
--- a/client.h
+++ b/client.h
@@ -15,7 +15,7 @@ struct ClientStats {
        std::string url;
        int sock;
        std::string remote_addr;
-       time_t connect_time;
+       timespec connect_time;
        size_t bytes_sent;
        size_t bytes_lost;
        size_t num_loss_events;
@@ -33,9 +33,11 @@ struct Client {
        // The file descriptor associated with this socket.
        int sock;
 
+       // When the client connected, in terms of CLOCK_MONOTONIC_COARSE.
+       timespec connect_time;
+
        // Some information only used for logging.
        std::string remote_addr;
-       time_t connect_time;
 
        enum State { READING_REQUEST, SENDING_HEADER, SENDING_DATA, SENDING_ERROR, WAITING_FOR_KEYFRAME, PREBUFFERING };
        State state;