Skip to content

Commit

Permalink
Update alink_gs - fix possible duplicate thread creation
Browse files Browse the repository at this point in the history
  • Loading branch information
sickgreg authored Oct 17, 2024
1 parent bbbc276 commit 63c613c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions alink_gs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ def connect_and_receive_msgpack():
udp_ip = config['Settings']['udp_ip']
udp_port = int(config['Settings']['udp_port'])
retry_interval = int(config['Settings']['retry_interval']) # Get retry interval from config

# Start UDP sending in a separate thread
udp_thread = threading.Thread(target=generate_package, daemon=True) # Change here to call generate_package
udp_thread.start()

while True:
try:
Expand All @@ -322,10 +326,6 @@ def connect_and_receive_msgpack():
if verbose_mode:
print(f"Connected to {host}:{port}")

# Start UDP sending in a separate thread
udp_thread = threading.Thread(target=generate_package, daemon=True) # Change here to call generate_package
udp_thread.start()

while True:
# First, read 4 bytes for the length prefix
length_prefix = client_socket.recv(4)
Expand Down

0 comments on commit 63c613c

Please sign in to comment.