Skip to content

Commit 0b0d052

Browse files
committed
Absorb all available data in ntripServer and tcpClient
1 parent 248be19 commit 0b0d052

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Firmware/RTK_Everywhere/NtripServer.ino

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,18 +451,16 @@ void ntripServerProcessRTCM(int serverIndex, uint8_t incoming)
451451
ntripServer->rtcmBytesSent = ntripServer->rtcmBytesSent + 1;
452452
ntripServer->timer = millis();
453453
netOutgoingRTCM = true;
454-
if (ntripServer->networkClient->available())
455-
ntripServer->networkClient->read(); // Gently absorb any unwanted incoming traffic
454+
while (ntripServer->networkClient->available())
455+
ntripServer->networkClient->read(); // Absorb any unwanted incoming traffic
456456
}
457457
// Failed to write the data
458458
else
459459
{
460460
// Done with this client connection
461-
if (!inMainMenu)
462-
systemPrintf("NTRIP Server %d breaking connection to %s\r\n", serverIndex,
461+
if (settings.debugNtripServerRtcm && (!inMainMenu))
462+
systemPrintf("NTRIP Server %d broken connection to %s\r\n", serverIndex,
463463
settings.ntripServer_CasterHost[serverIndex]);
464-
465-
ntripServerShutdown(serverIndex);
466464
}
467465
}
468466
}

Firmware/RTK_Everywhere/TcpClient.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ int32_t tcpClientSendData(uint16_t dataHead)
250250
if (bytesToSend < 0)
251251
bytesToSend += settings.gnssHandlerBufferSize;
252252

253-
if(tcpClient->available())
254-
tcpClient->read(); // Gently absorb any unwanted incoming traffic
253+
while(tcpClient->available())
254+
tcpClient->read(); // Absorb any unwanted incoming traffic
255255
}
256256

257257
// Failed to write the data

0 commit comments

Comments
 (0)