2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef CONNECTIONMANAGER_H
|
|
|
|
#define CONNECTIONMANAGER_H
|
|
|
|
|
|
|
|
class PeerWireClient;
|
|
|
|
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QSet>
|
|
|
|
|
|
|
|
class ConnectionManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static ConnectionManager *instance();
|
|
|
|
|
|
|
|
bool canAddConnection() const;
|
|
|
|
void addConnection(PeerWireClient *connection);
|
|
|
|
void removeConnection(PeerWireClient *connection);
|
|
|
|
int maxConnections() const;
|
|
|
|
QByteArray clientId() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QSet<PeerWireClient *> connections;
|
|
|
|
mutable QByteArray id;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|