def waitAllPacketsSent(self, timeout=None):
"""
Wait until all of the packets queued on this source have been pushed to
all connected ports. If timeout is given, it should be the maximum
number of seconds to wait before giving up.
"""
self._packetsSentCond.acquire()
try:
# Assume no spurious signals will occur, so we can defer to the
# timeout handling of Python's Condition object.
if self._packetsPending > 0:
self._packetsSentCond.wait(timeout)
finally:
self._packetsSentCond.release()
评论列表
文章目录