Skip to content

Commit

Permalink
fix: restore main loop functionality (#10)
Browse files Browse the repository at this point in the history
We need do something so main doesn't terminate.
  • Loading branch information
hairmare authored May 1, 2020
1 parent b17dac0 commit 6fd2485
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions box/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 6fd2485

Please sign in to comment.