Skip to content

Commit

Permalink
minor edit
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveKekacs committed Apr 25, 2018
1 parent 57abd45 commit 1a887e2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions autonomous_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@ def receive_video(protocol):
print("Socket for sending car commands created...")

print("Connecting sending socket to %s:%d..." % (SENDING_HOST_IP, COMMAND_PORT))
connected = False
while not connected:
while True:
# try to connect to socket, if not ready sleep and try again
try:
print("trying")
command_sock.connect((SENDING_HOST_IP, COMMAND_PORT))
connected = True
break
except:
time.sleep(1)
print("Connected sending socket to %s:%d..\n\n." % (SENDING_HOST_IP, COMMAND_PORT))
Expand Down Expand Up @@ -128,3 +126,4 @@ def receive_video(protocol):
receive_video(protocol)
else:
print("Error: Invalid argument")

0 comments on commit 1a887e2

Please sign in to comment.