* receiving 0 byte pending packages aswell, some may come from appiot

This commit is contained in:
Danyi Dávid 2018-03-02 22:40:00 +01:00
parent ab58b96f08
commit 10922666b3

View File

@ -106,8 +106,11 @@ void ArduinoClient::doWorkStep() {
// wait for socket event
SerialUSB.println(F("parsePacket()"));
size_t pending = data.nbIOT->socketBytesPending(data.sock);
if (pending > 0) {
if (pending >= 0) {
size_t numBytes = data.nbIOT->socketReceive(data.sock, packetBuffer, pending);
if (pending == 0) {
return;
}
connection_t * connP;
connP = connection_find(data.connList, data.sock);