Modify interface

This commit is contained in:
dijunkun
2023-07-20 09:50:44 +08:00
parent fbfaf9ac75
commit 5792ded4ac
9 changed files with 87 additions and 79 deletions

View File

@@ -1,13 +1,13 @@
#include <iostream>
#include "rtc.h"
#include "x.h"
int main(int argc, char **argv) {
int main(int argc, char** argv) {
Params params;
params.cfg_path = "../../../../config/config.ini";
CreatePeerConnectionWithID(params, "000000");
std::cout << "Finish CreatePeerConnectionWithID" << std::endl;
PeerPtr* peer = CreatePeer(&params);
JoinConnection(peer, "000000");
std::string msg = "Hello world";
@@ -15,7 +15,7 @@ int main(int argc, char **argv) {
while (i--) {
getchar();
std::cout << "Send data: [" << msg << "]" << std::endl;
SendData(msg.data(), msg.size());
SendData(peer, msg.data(), msg.size());
}
getchar();

View File

@@ -1,11 +1,13 @@
#include <iostream>
#include "rtc.h"
#include "x.h"
int main(int argc, char **argv) {
int main(int argc, char** argv) {
Params params;
params.cfg_path = "../../../../config/config.ini";
CreatePeerConnection(params);
PeerPtr* peer = CreatePeer(&params);
CreateConnection(peer);
getchar();
return 0;