Initial side dependent elements handling, initial multi col/row objects support, lousy bugfix about hanging on stopiing a module
This commit is contained in:
parent
7f03a0bd75
commit
35fcc5c801
13 changed files with 760 additions and 259 deletions
|
@ -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()));
|
||||
|
|
|
@ -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);}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue