]> git.sesse.net Git - cubemap/blobdiff - client.h
Change the connected time from time_t to timespec.
[cubemap] / client.h
index d23b860767e16ecc372ab5726c6df8f2044ae7e3..4e8003110b11c04e20b5a713f44b75cff294133a 100644 (file)
--- a/client.h
+++ b/client.h
@@ -15,7 +15,7 @@ struct ClientStats {
        std::string url;
        int sock;
        std::string remote_addr;
        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;
        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;
 
        // 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;
        // 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;
 
        enum State { READING_REQUEST, SENDING_HEADER, SENDING_DATA, SENDING_ERROR, WAITING_FOR_KEYFRAME, PREBUFFERING };
        State state;