27 _connections = connections;
31 return _activeConnections;
35 _activeConnections = newActiveConnections;
38QString WorkState::getWorkStateString()
const {
40 if (_activeConnections.size() >= maxConnectionCount)
53 QString result(
"State: %0 \n"
55 "Actived connections: %2 / %3 \n"
56 "Connected Addresses:\n"
61 result = result.arg(getWorkStateString()).
62 arg(_connections.size()).
63 arg(_activeConnections.size()).
64 arg(maxConnectionCount);
67 for (
const auto &i: _activeConnections) {
68 connections += i.toString() +
"\n";
71 result = result.arg(connections);
74 for (
const auto &i: _banedList) {
75 BanedList += i.toString() +
"\n";
78 result = result.arg(BanedList);
84 return maxConnectionCount;
88 maxConnectionCount = value;
96 _banedList = banedList;
QList< HostAddress > getBanedList() const
getBanedList This method return banned list of server.
void setActiveConnections(const QList< HostAddress > &newActiveConnections)
setActiveConnections this method sets new list of active connections.
void setMaxConnectionCount(int value)
setMaxConnectionCount this method set a new value of limit of connections.
const QList< HostAddress > & getConnections() const
getConnections This method return list of the current server connections.
void setIsRun(bool value)
setIsRun This method set new value for run flag.
bool IsRun() const
getIsRun This method return true if server is runed.
void setBanedList(const QList< HostAddress > &banedList)
setBanedList -this method set banned list for this object.
int getMaxConnectionCount() const
getMaxConnectionCount This method return of limit of connections.
void setConnections(const QList< HostAddress > &connections)
setConnections This method sets connections list.
const QList< HostAddress > & activeConnections() const
activeConnections This method return list of actived connections.
QString toString() const
toString This method convert state of work to string value.
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...