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,