From 6fd2485fcca1c4ee133632383ce69c5efda5de8f Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Fri, 1 May 2020 23:05:44 +0200 Subject: [PATCH] fix: restore main loop functionality (#10) We need do something so main doesn't terminate. --- box/box.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/box/box.go b/box/box.go index e2cd03e..68f67a1 100644 --- a/box/box.go +++ b/box/box.go @@ -159,12 +159,12 @@ func Execute(sendUDP bool, targetAddr string, pathfinderAddr string, pathfinderA writeTCP(pathfinder, fmt.Sprintf("SUB %s", device)) writeTCP(pathfinder, fmt.Sprintf("GET %s", device)) - if sendUDP { - for { + for { + if sendUDP { if atomic.LoadInt32(&targetMessage) != 0 { writeUDP(target, fmt.Sprintf("%d\r\n", atomic.LoadInt32(&targetMessage))) } - time.Sleep(600 * time.Millisecond) } + time.Sleep(600 * time.Millisecond) } }