Convert sbs message to bytes before sending

This commit is contained in:
Jared Dulmage 2020-05-05 22:56:50 -06:00
parent 5f7c6f57c8
commit 6614f6ce43

View File

@ -93,8 +93,9 @@ class output_sbs1:
try:
sbs1_msg = self.parse(msg)
if sbs1_msg is not None:
sbs1_bytes = sbs1_msg.encode('utf-8')
for conn in self._conns[:]: #iterate over a copy of the list
conn.send(sbs1_msg)
conn.send(sbs1_bytes)
except socket.error:
self._conns.remove(conn)
print("Connections: ", len(self._conns))