| 228 | } |
| 229 | |
| 230 | function resetMonitorState(monitor: Monitor) { |
| 231 | monitor.monitorId?.stop(); |
| 232 | monitor.monitorId = undefined; |
| 233 | |
| 234 | monitor.rttPinger?.close(); |
| 235 | monitor.rttPinger = undefined; |
| 236 | |
| 237 | monitor.cancellationToken.emit('cancel'); |
| 238 | |
| 239 | monitor.connection?.destroy(); |
| 240 | monitor.connection = null; |
| 241 | |
| 242 | monitor.clearRttSamples(); |
| 243 | } |
| 244 | |
| 245 | function useStreamingProtocol(monitor: Monitor, topologyVersion: TopologyVersion | null): boolean { |
| 246 | // If we have no topology version we always poll no matter |