MCPcopy Create free account
hub / github.com/Syncplay/syncplay / receiveMessage

Method receiveMessage

syncplay/protocols.py:801–813  ·  view source on GitHub ↗
(self, timestamp, senderRtt)

Source from the content-addressed store, hash-verified

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

Callers 2

_handleStatePingMethod · 0.80
handleStateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected