Skip to content

Commit

Permalink
DCS export script using non blocking receive
Browse files Browse the repository at this point in the history
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
  • Loading branch information
derammo committed Dec 24, 2020
1 parent b1214d5 commit ec25571
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Helios/Interfaces/DCS/Common/HeliosExport16.lua
Expand Up @@ -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")

Expand Down

0 comments on commit ec25571

Please sign in to comment.