diff options
Diffstat (limited to 'examples/network/torrent/peerwireclient.cpp')
-rw-r--r-- | examples/network/torrent/peerwireclient.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/network/torrent/peerwireclient.cpp b/examples/network/torrent/peerwireclient.cpp index 56feec5959..f6f81215a1 100644 --- a/examples/network/torrent/peerwireclient.cpp +++ b/examples/network/torrent/peerwireclient.cpp @@ -7,11 +7,13 @@ #include <QTimerEvent> #include <QtEndian> -static const int PendingRequestTimeout = 60 * 1000; -static const int ClientTimeout = 120 * 1000; -static const int ConnectTimeout = 60 * 1000; -static const int KeepAliveInterval = 30 * 1000; -static const int PeerRateControlTimerDelay = 2000; +#include <chrono> + +static constexpr std::chrono::seconds PendingRequestTimeout(60); +static constexpr std::chrono::seconds ClientTimeout(120); +static constexpr std::chrono::seconds ConnectTimeout(60); +static constexpr std::chrono::seconds KeepAliveInterval(30); +static constexpr std::chrono::seconds PeerRateControlTimerDelay(2); static const int MinimalHeaderSize = 48; static const char ProtocolId[] = "BitTorrent protocol"; static const char ProtocolIdSize = 19; |