connectivity handling, audio publishing

This commit is contained in:
David Zhao
2021-08-04 10:59:41 -07:00
parent aec2003140
commit 593890331e
14 changed files with 208 additions and 33 deletions
+14
View File
@@ -0,0 +1,14 @@
import 'dart:io';
import 'package:web_socket_channel/io.dart';
import 'package:web_socket_channel/web_socket_channel.dart';
Future<WebSocketChannel> connectToWebSocket(Uri uri) async {
try {
// ignore: close_sinks
var ws = await WebSocket.connect(uri.toString());
return IOWebSocketChannel(ws);
} catch (e) {
return Future.error(e);
}
}