Skip to content

Commit

Permalink
update.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Dec 18, 2023
1 parent 38c4d2c commit 295a318
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions lib/src/core/engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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}');
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/signal_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class SignalClient extends Disposable with EventsEmittable<SignalEvent> {
return;
}

_ws.sendMessage(req.writeToBuffer());
_ws.send(req.writeToBuffer());
}

Future<void> _onSocketData(dynamic message) async {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/transport.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Transport extends Disposable {
late final negotiate = Utils.createDebounceFunc(
(void _) => createAndSendOffer(),
cancelFunc: (f) => _cancelDebounce = f,
wait: connectOptions.timeouts.debounce * 2,
wait: connectOptions.timeouts.debounce,
);

Future<void> setRemoteDescription(rtc.RTCSessionDescription sd) async {
Expand Down
10 changes: 5 additions & 5 deletions lib/src/support/websocket_utility.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -164,7 +164,7 @@ class WebSocketUtility {
}
}

webSocketOnError(e) {
void webSocketOnError(e) {
WebSocketException ex = e;
onError?.call(ex);
}
Expand Down Expand Up @@ -192,12 +192,12 @@ class WebSocketUtility {
_cleanUp();
}

void sendMessage(message) {
void send(List<int> data) {
if (_socketStatus != SocketStatus.kSocketStatusConnected) {
logger.warning('WebSocket not connected');
return;
}
_webSocket?.send(message);
_webSocket?.send(data);
}

Future<bool> reconnect() async {
Expand Down

0 comments on commit 295a318

Please sign in to comment.