diff --git a/lib/src/core/engine.dart b/lib/src/core/engine.dart index 62f14a2a5..d37c30f20 100644 --- a/lib/src/core/engine.dart +++ b/lib/src/core/engine.dart @@ -866,9 +866,7 @@ extension EnginePrivateMethods on Engine { void _updateConnectionState(ConnectionState newValue, {DisconnectReason? reason}) { - if (_connectionState == newValue) { - return; - } + if (_connectionState == newValue) return; logger.fine('Engine ConnectionState ' '${_connectionState.name} -> ${newValue.name}'); diff --git a/lib/src/core/signal_client.dart b/lib/src/core/signal_client.dart index dc28c0cc8..16aa21e72 100644 --- a/lib/src/core/signal_client.dart +++ b/lib/src/core/signal_client.dart @@ -185,7 +185,7 @@ class SignalClient extends Disposable with EventsEmittable { return; } - _ws.sendMessage(req.writeToBuffer()); + _ws.send(req.writeToBuffer()); } Future _onSocketData(dynamic message) async { diff --git a/lib/src/support/websocket_utility.dart b/lib/src/support/websocket_utility.dart index 5a3fe3e94..6bc60a66d 100644 --- a/lib/src/support/websocket_utility.dart +++ b/lib/src/support/websocket_utility.dart @@ -147,11 +147,11 @@ class WebSocketUtility { _changeSocketStatus(SocketStatus.kSocketStatusConnected); } - webSocketOnMessage(data) { + void webSocketOnMessage(data) { onMessage?.call(data); } - webSocketOnDone() { + void webSocketOnDone() { logger.fine('closed'); if (_socketStatus == SocketStatus.kSocketStatusConnected) { _webSocket?.dispose(); @@ -164,7 +164,7 @@ class WebSocketUtility { } } - webSocketOnError(e) { + void webSocketOnError(e) { WebSocketException ex = e; onError?.call(ex); } @@ -192,12 +192,12 @@ class WebSocketUtility { _cleanUp(); } - void sendMessage(message) { + void send(List data) { if (_socketStatus != SocketStatus.kSocketStatusConnected) { logger.warning('WebSocket not connected'); return; } - _webSocket?.send(message); + _webSocket?.send(data); } Future reconnect() async {