Skip to content

Commit

Permalink
add TODO related to issue #9. copyedit comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
rouyng committed Dec 28, 2023
1 parent 2863336 commit 7c68d55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tncexporter/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ async def receive_packets(self):
as byte strings.
"""
# set the socket to non-blocking. If this is not set manually in Python 3.7, sock_recv will
# block other tasks. It is only set once we begin recieving packets for metric calclations,
# block other tasks. It is only set once we begin receiving packets for metric calculations,
# because the earlier socket operations to create a connection to the TNC can run
# synchronously. Therefore there is no reason to set nonblocking early
# synchronously. Therefore, there is no reason to set nonblocking early
# and create extra complexity.
self.client_socket.setblocking(False)
# loop to listen for packets sent from the TNC and add them to the queue for metrics
Expand All @@ -122,6 +122,8 @@ async def receive_packets(self):
if chunk == b'':
raise ConnectionResetError("Socket connection broken")
except ConnectionResetError:
# FIXME: reconnection blocks updating metrics, per issue #9
# https://github.com/rouyng/tncexporter/issues/9
logging.error("Connection to TNC was reset")
self.client_socket.close()
# remake client socket
Expand Down

0 comments on commit 7c68d55

Please sign in to comment.