Close WebSocketExtraneousEventHandler.

This commit is contained in:
Tobe O 2019-02-03 14:35:33 -05:00
parent 0dbdd96e8c
commit 66d3fb2e04
2 changed files with 6 additions and 0 deletions

View file

@ -1,5 +1,6 @@
# 2.0.1
* Add `reconnectOnClose` and `reconnectinterval` parameters in top-level `WebSockets` constructors.
* Close `WebSocketExtraneousEventHandler`.
# 2.0.0
* Update to work with `client@2.0.0`.

View file

@ -94,6 +94,7 @@ abstract class BaseWebSocketClient extends BaseAngelClient {
@override
Future close() async {
on._close();
await _socket.sink.close(status.goingAway);
_onData.close();
_onAllEvents.close();
@ -434,4 +435,8 @@ class WebSocketExtraneousEventHandler {
return _events[index].stream;
}
void _close() {
_events.values.forEach((s) => s.close());
}
}