mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Make use of chrono literals from std library
This commit is contained in:
parent
2a5dbe840c
commit
6de72ecc77
17 changed files with 57 additions and 32 deletions
|
@ -31,6 +31,7 @@
|
|||
#include "server.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
|
||||
#include <QNetworkProxy>
|
||||
#include <QSslCipher>
|
||||
|
@ -44,11 +45,13 @@
|
|||
#include "base/utils/net.h"
|
||||
#include "connection.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
namespace
|
||||
{
|
||||
const int KEEP_ALIVE_DURATION = 7 * 1000; // milliseconds
|
||||
const int KEEP_ALIVE_DURATION = std::chrono::milliseconds(7s).count();
|
||||
const int CONNECTIONS_LIMIT = 500;
|
||||
const int CONNECTIONS_SCAN_INTERVAL = 2; // seconds
|
||||
const std::chrono::seconds CONNECTIONS_SCAN_INTERVAL {2};
|
||||
|
||||
QList<QSslCipher> safeCipherList()
|
||||
{
|
||||
|
@ -81,7 +84,7 @@ Server::Server(IRequestHandler *requestHandler, QObject *parent)
|
|||
|
||||
auto *dropConnectionTimer = new QTimer(this);
|
||||
connect(dropConnectionTimer, &QTimer::timeout, this, &Server::dropTimedOutConnection);
|
||||
dropConnectionTimer->start(CONNECTIONS_SCAN_INTERVAL * 1000);
|
||||
dropConnectionTimer->start(CONNECTIONS_SCAN_INTERVAL);
|
||||
}
|
||||
|
||||
void Server::incomingConnection(const qintptr socketDescriptor)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue