43 lines
698 B
C++
43 lines
698 B
C++
#include "cloudserver.h"
|
|
|
|
CloudServer::CloudServer(DispatcherClient * c, const PIString & sname) : server(c) {
|
|
setName(sname);
|
|
server_name = sname;
|
|
}
|
|
|
|
|
|
CloudServer::~CloudServer() {
|
|
for (auto c :clients) {
|
|
c->close();
|
|
}
|
|
}
|
|
|
|
|
|
PIString CloudServer::serverName() const {
|
|
return server_name;
|
|
}
|
|
|
|
|
|
void CloudServer::addClient(DispatcherClient * c) {
|
|
clients << c;
|
|
}
|
|
|
|
|
|
void CloudServer::removeClient(DispatcherClient * c) {
|
|
clients.removeOne(c);
|
|
}
|
|
|
|
|
|
PIVector<DispatcherClient *> CloudServer::getClients() {
|
|
return clients;
|
|
}
|
|
|
|
|
|
void CloudServer::printStatus() {
|
|
piCout << " " << "Clients for" << server->address() << ":";
|
|
for (auto c: clients) {
|
|
piCout << " " << c->address();
|
|
}
|
|
}
|
|
|