Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pySC/control_system/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def start_server(SC: "SimulatedCommissioning" , port : int = 13131, refresh_rate
s.settimeout(refresh_rate)
print("Socket successfully created")
atexit.register(s.close)
start_time = time.time()
while True:
#if time.time() > start_time + refresh_rate:
print('Calculating orbit...')
if mode == 0:
orbit_x, orbit_y = SC.bpm_system.capture_orbit()
Expand All @@ -40,6 +42,7 @@ def start_server(SC: "SimulatedCommissioning" , port : int = 13131, refresh_rate
## this is an extra check to raise a timeout error if the server has
## been accepting commands for more than 'timeout'.
if time.time() > start_time + refresh_rate:
break
raise socket.timeout

conn, addr = s.accept()
Expand Down Expand Up @@ -73,5 +76,4 @@ def start_server(SC: "SimulatedCommissioning" , port : int = 13131, refresh_rate
send_int(conn, 0)
raise socket.timeout
except socket.timeout:
break

continue
Loading