File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed
Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -445,11 +445,25 @@ void ntripServerProcessRTCM(int serverIndex, uint8_t incoming)
445445
446446 if (ntripServer->networkClient && ntripServer->networkClient ->connected ())
447447 {
448- ntripServer->networkClient ->write (incoming); // Send this byte to socket
449- ntripServer->bytesSent = ntripServer->bytesSent + 1 ;
450- ntripServer->rtcmBytesSent = ntripServer->rtcmBytesSent + 1 ;
451- ntripServer->timer = millis ();
452- netOutgoingRTCM = true ;
448+ if (ntripServer->networkClient ->write (incoming) == 1 ) // Send this byte to socket
449+ {
450+ ntripServer->bytesSent = ntripServer->bytesSent + 1 ;
451+ ntripServer->rtcmBytesSent = ntripServer->rtcmBytesSent + 1 ;
452+ ntripServer->timer = millis ();
453+ netOutgoingRTCM = true ;
454+ if (ntripServer->networkClient ->available ())
455+ ntripServer->networkClient ->read (); // Gently absorb any unwanted incoming traffic
456+ }
457+ // Failed to write the data
458+ else
459+ {
460+ // Done with this client connection
461+ if (!inMainMenu)
462+ systemPrintf (" NTRIP Server %d breaking connection to %s\r\n " , serverIndex,
463+ settings.ntripServer_CasterHost [serverIndex]);
464+
465+ ntripServerShutdown (serverIndex);
466+ }
453467 }
454468 }
455469
You can’t perform that action at this time.
0 commit comments