mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Update checkKeepalive to also check LastReceived
Ping Candidate if remote.LastReceived is over than keepaliveInterval
This commit is contained in:
@@ -56,6 +56,7 @@ Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contribu
|
||||
* [Henry](https://github.com/cryptix)
|
||||
* [Jerko Steiner](https://github.com/jeremija)
|
||||
* [Sidney San Martín](https://github.com/s4y)
|
||||
* [JooYoung Lim](https://github.com/DevRockstarZ)
|
||||
|
||||
### License
|
||||
MIT License - see [LICENSE](LICENSE) for full text
|
||||
|
||||
@@ -692,7 +692,8 @@ func (a *Agent) checkKeepalive() {
|
||||
}
|
||||
|
||||
if (a.keepaliveInterval != 0) &&
|
||||
(time.Since(selectedPair.local.LastSent()) > a.keepaliveInterval) {
|
||||
((time.Since(selectedPair.local.LastSent()) > a.keepaliveInterval) ||
|
||||
(time.Since(selectedPair.remote.LastReceived()) > a.keepaliveInterval)) {
|
||||
// we use binding request instead of indication to support refresh consent schemas
|
||||
// see https://tools.ietf.org/html/rfc7675
|
||||
a.selector.PingCandidate(selectedPair.local, selectedPair.remote)
|
||||
|
||||
Reference in New Issue
Block a user