瀏覽代碼

Fixed second datachannel test

Paul-Louis Ageneau 3 年之前
父節點
當前提交
01c12d5a1d
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      test/connectivity.cpp
  2. 2 2
      test/turn_connectivity.cpp

+ 2 - 2
test/connectivity.cpp

@@ -195,13 +195,13 @@ void test_connectivity() {
 	});
 
 	auto second1 = pc1.createDataChannel("second");
-	second1->onOpen([wsecond1 = make_weak_ptr(dc1)]() {
+	second1->onOpen([wsecond1 = make_weak_ptr(second1)]() {
 		if (auto second1 = wsecond1.lock()) {
 			cout << "Second DataChannel 1: Open" << endl;
 			second1->send("Second hello from 1");
 		}
 	});
-	dc1->onMessage([](const variant<binary, string> &message) {
+	second1->onMessage([](const variant<binary, string> &message) {
 		if (holds_alternative<string>(message)) {
 			cout << "Second Message 1: " << get<string>(message) << endl;
 		}

+ 2 - 2
test/turn_connectivity.cpp

@@ -198,7 +198,7 @@ void test_turn_connectivity() {
 	});
 
 	auto second1 = pc1.createDataChannel("second");
-	second1->onOpen([wsecond1 = make_weak_ptr(dc1)]() {
+	second1->onOpen([wsecond1 = make_weak_ptr(second1)]() {
 		auto second1 = wsecond1.lock();
 		if (!second1)
 			return;
@@ -206,7 +206,7 @@ void test_turn_connectivity() {
 		cout << "Second DataChannel 1: Open" << endl;
 		second1->send("Second hello from 1");
 	});
-	dc1->onMessage([](const variant<binary, string> &message) {
+	second1->onMessage([](const variant<binary, string> &message) {
 		if (holds_alternative<string>(message)) {
 			cout << "Second Message 1: " << get<string>(message) << endl;
 		}