From 35a3ce6402e20ef167a26d5df5ef9bfa1701d831 Mon Sep 17 00:00:00 2001 From: andrey Date: Wed, 1 Sep 2021 10:56:11 +0300 Subject: [PATCH] picloudtcp.cpp revert some mutex --- libs/cloud/picloudserver.cpp | 4 ++-- libs/cloud/picloudtcp.cpp | 8 ++++---- utils/cloud_dispatcher/dispatcherserver.cpp | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/cloud/picloudserver.cpp b/libs/cloud/picloudserver.cpp index ad7500f4..3f1dd9b7 100644 --- a/libs/cloud/picloudserver.cpp +++ b/libs/cloud/picloudserver.cpp @@ -26,9 +26,9 @@ PICloudServer::PICloudServer(const PIString & path, PIIODevice::DeviceMode mode) tcp.setServerName(server_name); setName("cloud_server__" + server_name); CONNECTU(&streampacker, packetReceiveEvent, this, _readed); - CONNECTL(ð, connected, [this](){opened_ = true; tcp.sendStart();}); + CONNECTL(ð, connected, [this](){opened_ = true; piCoutObj << "connected"; tcp.sendStart();}); CONNECTL(ð, disconnected, [this](bool){ - //piCoutObj << "disconnected"; + piCoutObj << "disconnected"; static_cast(ð)->stop(); opened_ = false; ping_timer.stop(false); diff --git a/libs/cloud/picloudtcp.cpp b/libs/cloud/picloudtcp.cpp index 3a55860b..62dcbd95 100644 --- a/libs/cloud/picloudtcp.cpp +++ b/libs/cloud/picloudtcp.cpp @@ -72,9 +72,9 @@ void PICloud::TCP::sendConnected(uint client_id) { header.type = PICloud::TCP::Connect; PIByteArray ba; ba << header << client_id; - mutex_send.lock(); +// mutex_send.lock(); streampacker->send(ba); - mutex_send.unlock(); +// mutex_send.unlock(); } @@ -82,9 +82,9 @@ void PICloud::TCP::sendDisconnected(uint client_id) { header.type = PICloud::TCP::Disconnect; PIByteArray ba; ba << header << client_id; - mutex_send.lock(); +// mutex_send.lock(); streampacker->send(ba); - mutex_send.unlock(); +// mutex_send.unlock(); } diff --git a/utils/cloud_dispatcher/dispatcherserver.cpp b/utils/cloud_dispatcher/dispatcherserver.cpp index b5e53228..f4c3f1d4 100644 --- a/utils/cloud_dispatcher/dispatcherserver.cpp +++ b/utils/cloud_dispatcher/dispatcherserver.cpp @@ -7,6 +7,7 @@ DispatcherServer::DispatcherServer(PIEthernet::Address addr) : eth(PIEthernet::T max_connections = 1000; eth.setParameter(PIEthernet::ReuseAddress); eth.setReadAddress(addr); +// eth.setDebug(false); CONNECTU(ð, newConnection, this, newConnection); CONNECTU(&timeout_timer, tickEvent, this, cleanClients); }