From 09067eecda9366b982324a0f87b549f0db00495e Mon Sep 17 00:00:00 2001
From: James Turner <zakalawe@mac.com>
Date: Mon, 17 Aug 2020 12:15:40 +0100
Subject: [PATCH] Protocols: additional Hz rate validation

Patch by Huntley Palmer, to warn when passing Hz=0 for the protocol
args, which does not work so well.
---
 src/Main/fg_io.cxx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/Main/fg_io.cxx b/src/Main/fg_io.cxx
index c22b85f38..2a8412b8b 100644
--- a/src/Main/fg_io.cxx
+++ b/src/Main/fg_io.cxx
@@ -314,6 +314,10 @@ FGIO::parse_port_config( const string_list& tokens )
         SG_LOG( SG_IO, SG_INFO, "  port = " << port );
         SG_LOG( SG_IO, SG_INFO, "  style = " << style );
 
+        if (hertz <= 0) {
+            SG_LOG(SG_IO, SG_ALERT, "Non-Positive Hz rate may block generic I/O ");
+        }
+
         io->set_io_channel( new SGSocket( hostname, port, style ) );
     }
     else