pingInterval property
Implementation
set pingInterval(Duration interval) {
_pingTimer?.cancel();
_pingInterval = interval;
if (_pingInterval.inSeconds == 0) return;
_pingTimer = Timer.periodic(interval, (timer) {
if (waitingPong) {
// No pong received.
timer.cancel();
close();
} else {
waitingPong = true;
sendMessage(Ping());
}
});
}