Expose dataChannel for e2e testing. (#161)

This commit is contained in:
CloudWebRTC
2022-09-07 15:15:23 +08:00
committed by GitHub
parent cbdfa634a3
commit 8b88f9cb34
4 changed files with 18 additions and 9 deletions
+9
View File
@@ -43,6 +43,10 @@ class Engine extends Disposable with EventsEmittable<EngineEvent> {
@internal
Transport? get primary => _subscriberPrimary ? subscriber : publisher;
rtc.RTCDataChannel? get dataChannel => _subscriberPrimary
? _reliableDCSub ?? _lossyDCSub
: _reliableDCPub ?? _lossyDCPub;
// data channels for packets
rtc.RTCDataChannel? _reliableDCPub;
rtc.RTCDataChannel? _lossyDCPub;
@@ -110,6 +114,11 @@ class Engine extends Disposable with EventsEmittable<EngineEvent> {
this.roomOptions = roomOptions ?? this.roomOptions;
this.fastConnectOptions = fastConnectOptions;
if (connectionState == ConnectionState.connected) {
logger.fine('already connected');
return;
}
_updateConnectionState(ConnectionState.connecting);
try {