Paul-Louis Ageneau 4 سال پیش
والد
کامیت
d8515b6362
2فایلهای تغییر یافته به همراه8 افزوده شده و 15 حذف شده
  1. 8 9
      examples/client/main.cpp
  2. 0 6
      test/capi_connectivity.cpp

+ 8 - 9
examples/client/main.cpp

@@ -36,7 +36,6 @@
 #include <thread>
 #include <unordered_map>
 
-
 using namespace rtc;
 using namespace std;
 using namespace std::chrono_literals;
@@ -167,12 +166,12 @@ int main(int argc, char **argv) try {
 
 		dc->onClosed([id]() { cout << "DataChannel from " << id << " closed" << endl; });
 
-		dc->onMessage([id, wdc = make_weak_ptr(dc)](const variant<binary, string> &message) {
-			if (holds_alternative<string>(message))
-				cout << "Message from " << id << " received: " << get<string>(message) << endl;
+		dc->onMessage([id, wdc = make_weak_ptr(dc)](variant<binary, string> data) {
+			if (holds_alternative<string>(data))
+				cout << "Message from " << id << " received: " << get<string>(data) << endl;
 			else
 				cout << "Binary message from " << id
-				     << " received, size=" << get<binary>(message).size() << endl;
+				     << " received, size=" << get<binary>(data).size() << endl;
 		});
 
 		dataChannelMap.emplace(id, dc);
@@ -225,12 +224,12 @@ shared_ptr<PeerConnection> createPeerConnection(const Configuration &config,
 
 		dc->onClosed([id]() { cout << "DataChannel from " << id << " closed" << endl; });
 
-		dc->onMessage([id, wdc = make_weak_ptr(dc)](const variant<binary, string> &message) {
-			if (holds_alternative<string>(message))
-				cout << "Message from " << id << " received: " << get<string>(message) << endl;
+		dc->onMessage([id, wdc = make_weak_ptr(dc)](variant<binary, string> data) {
+			if (holds_alternative<string>(data))
+				cout << "Message from " << id << " received: " << get<string>(data) << endl;
 			else
 				cout << "Binary message from " << id
-				     << " received, size=" << get<binary>(message).size() << endl;
+				     << " received, size=" << get<binary>(data).size() << endl;
 		});
 
 		dc->send("Hello from " + localId);

+ 0 - 6
test/capi_connectivity.cpp

@@ -227,12 +227,6 @@ int test_capi_connectivity_main() {
 		goto error;
 	}
 
-	if (peer1->signalingState != RTC_SIGNALING_STABLE ||
-	    peer2->signalingState != RTC_SIGNALING_STABLE) {
-		fprintf(stderr, "Signaling state is not stable\n");
-		goto error;
-	}
-
 	if (!peer1->connected || !peer2->connected) {
 		fprintf(stderr, "DataChannel is not connected\n");
 		goto error;