Skip to content

Commit

Permalink
Add a comment why priority is necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
polybassa committed Feb 9, 2021
1 parent 56be179 commit cf73eac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scapy/contrib/cansocket_python_can.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@


class PriotizedCanMessage(object):
"""Helper object for comparison of CAN messages. If the timestamps of two
messages are equal, the counter value of a priority counter, is used
for comparison. It's only important that this priority counter always
get increased for every CAN message in the receive heapq. This compensates
a low resolution of `time.time()` on some operating systems.
"""
def __init__(self, msg, count):
# type: (can_Message, int) -> None
self.msg = msg
Expand Down

0 comments on commit cf73eac

Please sign in to comment.