From ec25571b37360789d16656ff9c4c5937e3d5b279 Mon Sep 17 00:00:00 2001 From: derammo <817160+derammo@users.noreply.github.com> Date: Wed, 23 Dec 2020 19:42:09 -0500 Subject: [PATCH] DCS export script using non blocking receive this will reduce the DCS FPS impact of using Helios, in some cases dramatically this change partially implements #373 thanks to @charlestytler for the code change suggestion --- Helios/Interfaces/DCS/Common/HeliosExport16.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Helios/Interfaces/DCS/Common/HeliosExport16.lua b/Helios/Interfaces/DCS/Common/HeliosExport16.lua index 6d86d744c..742c3a1bd 100644 --- a/Helios/Interfaces/DCS/Common/HeliosExport16.lua +++ b/Helios/Interfaces/DCS/Common/HeliosExport16.lua @@ -339,7 +339,10 @@ function helios_impl.init() helios_private.clientSocket = helios_private.socketLibrary.udp() helios_private.clientSocket:setsockname("*", 0) helios_private.clientSocket:setoption("broadcast", true) - helios_private.clientSocket:settimeout(.001) -- blocking, but for a very short time + helios_private.clientSocket:settimeout(0) -- non-blocking + + -- NOTE: the following code was in Helios from 2014 to 2020 for reasons nobody remembers: + -- helios_private.clientSocket:settimeout(.001) -- blocking, but for a very short time log.write("HELIOS.EXPORT", log.DEBUG, "loaded")