Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rnsh/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, target_period: float):
def next_sleep_time(self) -> float:
old_last_wake = self.last_wake
self.last_wake = time.time()
next_wake = max(old_last_wake + 0.01, self.last_wake)
next_wake = max(old_last_wake + self.target_period, self.last_wake)
sleep_for = next_wake - self.last_wake
return sleep_for if sleep_for > 0 else 0

Expand Down
2 changes: 1 addition & 1 deletion rnsh/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def link_established(lnk: RNS.Link):
_destination.announce()

last_announce = time.time()
sleeper = helpers.SleepRate(0.01)
sleeper = helpers.SleepRate(0.25)

try:
while not await _check_finished():
Expand Down
4 changes: 2 additions & 2 deletions rnsh/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ def _initiator_identified(self, outlet, identity):
self._set_state(LSState.LSSTATE_WAIT_VERS)

@classmethod
async def pump_all(cls) -> True:
async def pump_all(cls) -> bool:
processed_any = False
for session in cls.sessions:
processed = session.pump()
processed_any = processed_any or processed
await asyncio.sleep(0)

return processed_any

@classmethod
async def terminate_all(cls, reason: str):
Expand Down