mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
Fix stun error on answer side
This commit is contained in:
@@ -84,7 +84,6 @@ int IceTransport::InitIceTransport(std::string &ip, int port,
|
||||
}
|
||||
},
|
||||
[](juice_agent_t *agent, const char *data, size_t size, void *user_ptr) {
|
||||
LOG_INFO("on_recv");
|
||||
if (user_ptr &&
|
||||
static_cast<IceTransport *>(user_ptr)->on_receive_ice_msg_cb_) {
|
||||
static_cast<IceTransport *>(user_ptr)->on_receive_ice_msg_cb_(data,
|
||||
|
||||
@@ -88,7 +88,7 @@ int PeerConnection::Init(PeerConnectionParams params, std::string const &id) {
|
||||
std::regex regex("\n");
|
||||
|
||||
int signal_server_port = stoi(cfg_signal_server_port);
|
||||
int stun_server_port = stoi(cfg_signal_server_port);
|
||||
int stun_server_port = stoi(cfg_stun_server_port);
|
||||
|
||||
on_receive_ws_msg_ = [this](const std::string &msg) {
|
||||
do {
|
||||
|
||||
@@ -9,7 +9,7 @@ int main(int argc, char** argv) {
|
||||
PeerPtr* peer = CreatePeer(¶ms);
|
||||
JoinConnection(peer, "000000");
|
||||
|
||||
std::string msg = "Hello world";
|
||||
std::string msg = "Offer peer";
|
||||
|
||||
int i = 100;
|
||||
while (i--) {
|
||||
|
||||
@@ -9,6 +9,15 @@ int main(int argc, char** argv) {
|
||||
PeerPtr* peer = CreatePeer(¶ms);
|
||||
CreateConnection(peer);
|
||||
|
||||
std::string msg = "Answer peer";
|
||||
|
||||
int i = 100;
|
||||
while (i--) {
|
||||
getchar();
|
||||
std::cout << "Send data: [" << msg << "]" << std::endl;
|
||||
SendData(peer, msg.data(), msg.size());
|
||||
}
|
||||
|
||||
getchar();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -78,13 +78,13 @@ target("signal_server")
|
||||
add_packages("asio", "nlohmann_json", "spdlog")
|
||||
add_includedirs("thirdparty/websocketpp/include")
|
||||
|
||||
target("Offer")
|
||||
target("offer")
|
||||
set_kind("binary")
|
||||
add_deps("projectx")
|
||||
add_files("tests/peerconnection/offer.cpp")
|
||||
add_includedirs("src/interface")
|
||||
|
||||
target("Answer")
|
||||
target("answer")
|
||||
set_kind("binary")
|
||||
add_deps("projectx")
|
||||
add_files("tests/peerconnection/answer.cpp")
|
||||
|
||||
Reference in New Issue
Block a user