try to fix cloud again

This commit is contained in:
2024-06-01 22:27:39 +03:00
parent af4b718053
commit d46b5e008a
8 changed files with 24 additions and 18 deletions

View File

@@ -22,6 +22,7 @@ void DispatcherClient::start() {
DispatcherClient::~DispatcherClient() {
PIMutexLocker send_lock(mutex_send);
piDeleteSafety(eth);
}
@@ -43,28 +44,32 @@ void DispatcherClient::stop() {
void DispatcherClient::sendConnected(uint client_id) {
piCoutObj << "sendConnected" << client_id;
PIMutexLocker send_lock(mutex_send);
tcp.sendConnected(client_id);
}
void DispatcherClient::sendDisconnected(uint client_id) {
piCoutObj << "sendDisconnected" << client_id;
PIMutexLocker send_lock(mutex_send);
tcp.sendDisconnected(client_id);
}
void DispatcherClient::sendData(const PIByteArray & data) {
if (tcp.role() == PICloud::TCP::Client)
if (tcp.role() == PICloud::TCP::Client) {
PIMutexLocker send_lock(mutex_send);
tcp.sendData(data);
else
} else
piCoutObj << "error sendData, invalid role";
}
void DispatcherClient::sendDataToClient(const PIByteArray & data, uint client_id) {
if (tcp.role() == PICloud::TCP::Server)
if (tcp.role() == PICloud::TCP::Server) {
PIMutexLocker send_lock(mutex_send);
tcp.sendData(data, client_id);
else
} else
piCoutObj << "error sendDataToClient, invalid role";
}