Merge pull request #495 from flok99/patch-1

Update PubSubClient.cpp
This commit is contained in:
Nick O'Leary 2018-11-01 23:28:22 +00:00 committed by GitHub
commit b5f90b679b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -561,6 +561,7 @@ void PubSubClient::disconnect() {
buffer[1] = 0; buffer[1] = 0;
_client->write(buffer,2); _client->write(buffer,2);
_state = MQTT_DISCONNECTED; _state = MQTT_DISCONNECTED;
_client->flush();
_client->stop(); _client->stop();
lastInActivity = lastOutActivity = millis(); lastInActivity = lastOutActivity = millis();
} }