Commit graph

4 commits

Author SHA1 Message Date
Victor Boivie
5d3bda58fd dcsctp: Add timer safeguards and sanity checks
Ensuring that timer durations never go beyond a safe maximum duration
and that timer IDs are not re-used.

Bug: webrtc:12614
Change-Id: I227a2e9933da16669dc6ea0a39c570892010ba2c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215063
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33860}
2021-04-28 06:58:29 +00:00
Victor Boivie
9861f960c3 dcsctp: Add operators on TimeMs and DurationMs
To be able to use them type-safely, they should support native
operators (e.g. adding a time and a duration, or subtracting two time
values), as the alternative is to manage them as numbers.

Yes, this makes them behave a bit like absl::Time/absl::Duration.

Bug: webrtc:12614
Change-Id: I4dea12e33698a46e71fb549f44c06f2f381c9201
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215143
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33725}
2021-04-14 09:21:15 +00:00
Victor Boivie
9d60936048 dcsctp: Fix relative dependency paths in timer/
Bug: webrtc:12614
Change-Id: I50cd2e5beae516e4a1ba47626d835eb9c80dffcb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214965
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33686}
2021-04-12 08:25:49 +00:00
Victor Boivie
6fa0cfa4dd dcsctp: Add Timer and TimerManager
Timer is a high-level timer (in contrast to the low-level `Timeout`
class). Timers are started and can be stopped or restarted. When a timer
expires, the provided callback will be triggered.

Timers can be configured to do e.g. exponential backoff when they expire
and how many times they should be automatically restarted.

Bug: webrtc:12614
Change-Id: Id5eddd58dd0af62184b10dd1f98e3e886e3f1d50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213350
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33666}
2021-04-09 07:48:50 +00:00