version 3.6.0

another fixes in PIEthernet
remove PIThread::interrupt()
piwaitevent patches
This commit is contained in:
2022-11-12 13:31:26 +03:00
parent 7bbffef237
commit e9128771db
11 changed files with 57 additions and 90 deletions

View File

@@ -90,6 +90,7 @@ PIVector<PICloudServer::Client *> PICloudServer::clients() const {
bool PICloudServer::openDevice() {
//piCout << "PICloudServer open device" << path();
if (is_deleted) return false;
bool op = eth.connect(PIEthernet::Address::resolve(path()), false);
if (op) {
eth.startThreadedRead();
@@ -244,6 +245,7 @@ void PICloudServer::_readed(PIByteArray & ba) {
Client * oc = index_clients.value(id, nullptr);
clients_mutex.unlock();
if (oc) {
piCoutObj << "Warning: reject client with duplicated ID";
tcp.sendDisconnected(id);
} else {
Client * c = new Client(this, id);
@@ -258,7 +260,7 @@ void PICloudServer::_readed(PIByteArray & ba) {
} break;
case PICloud::TCP::Disconnect: {
uint id = tcp.parseDisconnect(ba);
//piCoutObj << "remove Client" << id;
//piCoutObj << "Close on logic";
clients_mutex.lock();
Client * oc = index_clients.take(id, nullptr);
clients_.removeOne(oc);