Commit f700c159 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Fail on no connection in constructor

parent ba116337
......@@ -61,6 +61,15 @@ class Telescope:
self.offset_az = None
self.offset_el = None
try:
testsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
test_port = 11010
testsocket.connect((consoleHost, test_port))
except:
raise IOError(f"Cannot reach console at {consoleHost}")
finally:
testsocket.close()
_telescope__num_instances += 1
if _telescope__num_instances != 1:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment