(self, timestamp, senderRtt)
| 799 | return time.time() |
| 800 | |
| 801 | def receiveMessage(self, timestamp, senderRtt): |
| 802 | if not timestamp: |
| 803 | return |
| 804 | self._rtt = time.time() - timestamp |
| 805 | if self._rtt < 0 or senderRtt < 0: |
| 806 | return |
| 807 | if not self._avrRtt: |
| 808 | self._avrRtt = self._rtt |
| 809 | self._avrRtt = self._avrRtt * PING_MOVING_AVERAGE_WEIGHT + self._rtt * (1 - PING_MOVING_AVERAGE_WEIGHT) |
| 810 | if senderRtt < self._rtt: |
| 811 | self._fd = self._avrRtt / 2 + (self._rtt - senderRtt) |
| 812 | else: |
| 813 | self._fd = self._avrRtt / 2 |
| 814 | |
| 815 | def getLastForwardDelay(self): |
| 816 | return self._fd |
no outgoing calls
no test coverage detected