seeing-things / track

Automates tracking of targets with a telescope using ephemeris (TLE files) and/or optical tracking.
MIT License
7 stars 0 forks source link

Close mount connection in `TelescopeMount.__exit__()` #288

Closed bgottula closed 1 year ago

bgottula commented 1 year ago

TelescopeMount does not close its connection to the mount when __exit__() is called, which means that if a new object is created attempting to connect to the same mount it will fail with an error like the following:

Traceback (most recent call last):
  File "/home/rgottula/dev/track/./scratch/test_mount_disconnect.py", line 29, in <module>
    main()
  File "/home/rgottula/dev/track/./scratch/test_mount_disconnect.py", line 23, in main
    with mounts.make_mount_from_args(args) as mount:
  File "/home/rgottula/dev/track/track/mounts.py", line 721, in make_mount_from_args
    return LosmandyGeminiMount(
  File "/home/rgottula/dev/track/track/mounts.py", line 546, in __init__
    backend=point.gemini_backend.Gemini2BackendUDP(0.25, device_name),
  File "/home/rgottula/dev/point/point/gemini_backend.py", line 169, in __init__
    self._sock.bind(self._local_addr)
OSError: [Errno 98] Address already in use

Fix this.

bgottula commented 1 year ago

Fixed. Depends on corresponding changes in the point package.