PIIODevice threaded read refactoring

This commit is contained in:
2022-10-23 16:02:09 +03:00
parent e5777dde6c
commit 9438ab4e53
9 changed files with 157 additions and 121 deletions

View File

@@ -33,7 +33,7 @@ PICloudClient::PICloudClient(const PIString & path, PIIODevice::DeviceMode mode)
if (is_deleted) return;
bool need_disconn = is_connected;
//piCoutObj << "eth disconnected";
static_cast<PIThread*>(&eth)->stop();
eth.stopThreadedRead();
opened_ = false;
internalDisconnect();
if (need_disconn)
@@ -45,7 +45,7 @@ PICloudClient::PICloudClient(const PIString & path, PIIODevice::DeviceMode mode)
PICloudClient::~PICloudClient() {
//piCoutObj << "~PICloudClient()";
PIThread::stop();
softStopThreadedRead();
//eth.close();
//if (is_connected) disconnected();
close();
@@ -155,7 +155,7 @@ void PICloudClient::_readed(PIByteArray & ba) {
}
break;
case PICloud::TCP::Disconnect:
static_cast<PIThread*>(&eth)->stop();
eth.stopThreadedRead();
opened_ = false;
eth.close();
break;