Initial side dependent elements handling, initial multi col/row objects support, lousy bugfix about hanging on stopiing a module

This commit is contained in:
Blue 2019-03-23 15:47:05 +03:00
parent 7f03a0bd75
commit 35fcc5c801
13 changed files with 760 additions and 259 deletions

View file

@ -110,6 +110,10 @@ W::Socket * W::Server::createSocket(QWebSocket* socket)
}
Socket *wSocket = new Socket(name, socket, connectionId, this);
if (connections.find(connectionId) != connections.end()) {
throw new SocketIdDuplectation(connectionId);
}
connections[connectionId] = wSocket;
connect(wSocket, SIGNAL(connected()), SLOT(onSocketConnected()));
connect(wSocket, SIGNAL(disconnected()), SLOT(onSocketDisconnected()));

View file

@ -73,6 +73,16 @@ namespace W
std::string getMessage() const{return "An attempt to access non existing socket";}
};
class SocketIdDuplectation:
public Utils::Exception
{
public:
SocketIdDuplectation(uint64_t p_id):Exception(),id(p_id){}
uint64_t id;
std::string getMessage() const{return "An attempt to create a socket with duplicating id == " + std::to_string(id);}
};
};
}

View file

@ -106,8 +106,10 @@ void W::Socket::onSocketConnected()
void W::Socket::onSocketDisconnected()
{
state = disconnected_s;
emit disconnected();
if (state != disconnected_s) {
state = disconnected_s;
emit disconnected();
}
}
void W::Socket::onBinaryMessageReceived(const QByteArray& ba)