When add-on restarts, Home Assistant can't communicate with it

I’ve created a Hass.io add-on, ser2sock, that I am working the small kinks out of before releasing it to the public.

One issue I am having is that when I restart the add-on, Home Assistant can no longer communicate with it unless I restart Home Assistant. I know the add-on comes back up successfully because I am able to tail the logs for the container and hit the socket interface. If I bash into the homeassistant docker container and ping the other container, it is reachable and the IP address has no changed.

Any tricks here to make this more reliable?

EDIT: Here is the error Home Assistant puts in the log when after the add-on has been restarted when trying to make a call to it:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/alarmdecoder/devices.py”, line 1124, in write
data_sent = self._device.send(data)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.6/asyncio/tasks.py”, line 179, in _step
result = coro.send(None)
File “/usr/lib/python3.6/site-packages/homeassistant/core.py”, line 1031, in _event_to_service_call
yield from service_handler.func(service_call)
File “/usr/lib/python3.6/site-packages/homeassistant/components/alarm_control_panel/init.py”, line 142, in async_alarm_service_handler
yield from getattr(alarm, method)(code)
File “/usr/lib/python3.6/asyncio/coroutines.py”, line 210, in coro
res = func(*args, **kw)
File “/config/custom_components/alarm_control_panel/alarmdecoder.py”, line 116, in async_alarm_arm_home
File “/usr/lib/python3.6/site-packages/alarmdecoder/decoder.py”, line 261, in send
File “/usr/lib/python3.6/site-packages/alarmdecoder/devices.py”, line 1132, in write
raise CommError(‘Error writing to device.’, err)
alarmdecoder.util.CommError: (‘Error writing to device.’, OSError(9, ‘Bad file descriptor’))