Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appetite for refactoring to be SANS-IO (including time?) #391

Open
thomaseizinger opened this issue Jan 24, 2024 · 0 comments · May be fixed by #417
Open

Appetite for refactoring to be SANS-IO (including time?) #391

thomaseizinger opened this issue Jan 24, 2024 · 0 comments · May be fixed by #417

Comments

@thomaseizinger
Copy link
Contributor

This library is basically SANS-IO except for calls to Instant::now. I was wondering what the appetite is for changing that?

  • APIs like encapsulate and decapsulate should likely take an now: Instant parameter to accurately reflect timestamps of last received packets.
  • update_timers should also take a now: Instant parameter.

update_timers can save the provided now timestamp as local state and all other functions can compute durations etc based on that timestamp. Thus, accuracy of that depends entirely on the user in how often they call update_timers.

We might want to consider renaming update_timers to something like handle_timeout or update_now.

@thomaseizinger thomaseizinger changed the title Appetite for refactoring to be sans-io (including time?) Appetite for refactoring to be SANS-IO (including time?) Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant