From 75f1f4214237e99d272d156d625ac4f81e4db146 Mon Sep 17 00:00:00 2001 From: Michael Jansen Date: Fri, 22 Dec 2023 12:29:11 -0800 Subject: [PATCH] fix timeout interval comparing microseconds to milliseconds (#7) --- CHANGELOG.md | 4 ++++ lib/src/nt4_client.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed5cce7..ae204c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.1 + +- Fix connections being timed out too quickly + ## 1.3.0 - Added ability to retrieve cached values diff --git a/lib/src/nt4_client.dart b/lib/src/nt4_client.dart index ed10a6b..e64a58c 100644 --- a/lib/src/nt4_client.dart +++ b/lib/src/nt4_client.dart @@ -377,7 +377,7 @@ class NT4Client { int currentTime = _getClientTimeUS(); - if (currentTime - _lastReceivedTime > _timeoutInterval) { + if (currentTime - _lastReceivedTime > _timeoutInterval * 1000) { _wsOnClose(); } } diff --git a/pubspec.yaml b/pubspec.yaml index 77a35e5..823329f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: nt4 description: Dart implementation of the WPILib NT4 protocol -version: 1.3.0 +version: 1.3.1 repository: https://github.com/mjansen4857/nt4 environment: