PIClout data send and receive test
This commit is contained in:
@@ -113,8 +113,8 @@ bool PICloudServer::Client::openDevice() {
|
||||
|
||||
|
||||
bool PICloudServer::Client::closeDevice() {
|
||||
server->clientDisconnect(client_id);
|
||||
if (is_connected) {
|
||||
server->clientDisconnect(client_id);
|
||||
is_connected = false;
|
||||
cond_buff.notifyOne();
|
||||
}
|
||||
@@ -170,7 +170,10 @@ void PICloudServer::_readed(PIByteArray & ba) {
|
||||
case PICloud::TCP::Disconnect: {
|
||||
uint id = tcp.parseDisconnect(ba);
|
||||
Client * oc = index_clients.value(id, nullptr);
|
||||
if (oc) oc->close();
|
||||
if (oc) {
|
||||
oc->is_connected = false;
|
||||
oc->close();
|
||||
}
|
||||
} break;
|
||||
case PICloud::TCP::Data: {
|
||||
PIPair<uint, PIByteArray> d = tcp.parseDataServer(ba);
|
||||
|
||||
Reference in New Issue
Block a user