From 0dbdd96e8c8d3dc32f90f8212e8d36e534ec6c78 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Sun, 3 Feb 2019 14:34:00 -0500 Subject: [PATCH] * Add `reconnectOnClose` and `reconnectinterval` parameters in top-level `WebSockets` constructors. --- CHANGELOG.md | 3 +++ lib/browser.dart | 6 +++++- lib/flutter.dart | 6 +++++- lib/io.dart | 6 +++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eef45d67..32e6e8ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.1 +* Add `reconnectOnClose` and `reconnectinterval` parameters in top-level `WebSockets` constructors. + # 2.0.0 * Update to work with `client@2.0.0`. diff --git a/lib/browser.dart b/lib/browser.dart index d2278521..3f84ebc3 100644 --- a/lib/browser.dart +++ b/lib/browser.dart @@ -17,7 +17,11 @@ final RegExp _straySlashes = new RegExp(r"(^/)|(/+$)"); class WebSockets extends BaseWebSocketClient { final List _services = []; - WebSockets(path) : super(new http.BrowserClient(), path); + WebSockets(baseUrl, + {bool reconnectOnClose = true, Duration reconnectInterval}) + : super(new http.BrowserClient(), baseUrl, + reconnectOnClose: reconnectOnClose, + reconnectInterval: reconnectInterval); @override Future close() { diff --git a/lib/flutter.dart b/lib/flutter.dart index 3e6eee0b..e88b94be 100644 --- a/lib/flutter.dart +++ b/lib/flutter.dart @@ -17,7 +17,11 @@ export 'angel_websocket.dart'; class WebSockets extends BaseWebSocketClient { final List _services = []; - WebSockets(String path) : super(new http.IOClient(), path); + WebSockets(baseUrl, + {bool reconnectOnClose = true, Duration reconnectInterval}) + : super(new http.IOClient(), baseUrl, + reconnectOnClose: reconnectOnClose, + reconnectInterval: reconnectInterval); @override Stream authenticateViaPopup(String url, diff --git a/lib/io.dart b/lib/io.dart index 3d89406e..6bcfc0ed 100644 --- a/lib/io.dart +++ b/lib/io.dart @@ -18,7 +18,11 @@ final RegExp _straySlashes = new RegExp(r"(^/)|(/+$)"); class WebSockets extends BaseWebSocketClient { final List _services = []; - WebSockets(String path) : super(new http.IOClient(), path); + WebSockets(baseUrl, + {bool reconnectOnClose = true, Duration reconnectInterval}) + : super(new http.IOClient(), baseUrl, + reconnectOnClose: reconnectOnClose, + reconnectInterval: reconnectInterval); @override Stream authenticateViaPopup(String url,