mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
Fix stun port error
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
[signal server]
|
[signal server]
|
||||||
ip = 10.11.17.55
|
ip = localhost
|
||||||
port = 9002
|
port = 9002
|
||||||
|
|
||||||
[stun server]
|
[stun server]
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ int IceAgent::CreateIceAgent(juice_cb_state_changed_t on_state_changed,
|
|||||||
juice_config_t config;
|
juice_config_t config;
|
||||||
memset(&config, 0, sizeof(config));
|
memset(&config, 0, sizeof(config));
|
||||||
|
|
||||||
|
LOG_INFO("stun server ip[{}] port[{}]", ip_, port_);
|
||||||
|
|
||||||
// STUN server example
|
// STUN server example
|
||||||
config.stun_server_host = ip_.c_str();
|
config.stun_server_host = ip_.c_str();
|
||||||
config.stun_server_port = port_;
|
config.stun_server_port = port_;
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ int IceTransport::InitIceTransport(std::string &ip, int port) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
[](juice_agent_t *agent, const char *data, size_t size, void *user_ptr) {
|
[](juice_agent_t *agent, const char *data, size_t size, void *user_ptr) {
|
||||||
LOG_INFO("on_recv");
|
|
||||||
if (user_ptr &&
|
if (user_ptr &&
|
||||||
static_cast<IceTransport *>(user_ptr)->on_receive_ice_msg_cb_) {
|
static_cast<IceTransport *>(user_ptr)->on_receive_ice_msg_cb_) {
|
||||||
static_cast<IceTransport *>(user_ptr)->on_receive_ice_msg_cb_(data,
|
static_cast<IceTransport *>(user_ptr)->on_receive_ice_msg_cb_(data,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ int PeerConnection::Init(Params params) {
|
|||||||
LOG_INFO("Read config success");
|
LOG_INFO("Read config success");
|
||||||
|
|
||||||
int signal_server_port = stoi(cfg_signal_server_port);
|
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) {
|
on_receive_ws_msg_ = [this](const std::string &msg) {
|
||||||
do {
|
do {
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
#ifndef _RTC_H_
|
#ifndef _RTC_H_
|
||||||
#define _RTC_H_
|
#define _RTC_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
enum ws_status { WS_CONNECTING = 0, WS_OPEN, WS_FAILED, WS_CLOSED, WS_UNKNOWN };
|
enum ws_status { WS_CONNECTING = 0, WS_OPEN, WS_FAILED, WS_CLOSED, WS_UNKNOWN };
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
Params params;
|
Params params;
|
||||||
params.cfg_path = "config\config.ini";
|
params.cfg_path = "/home/zjlab/data/djk/projectx/config/config.ini";
|
||||||
CreatePeerConnectionWithID(params, "000000");
|
CreatePeerConnectionWithID(params, "000000");
|
||||||
|
|
||||||
std::cout << "Finish CreatePeerConnectionWithID" << std::endl;
|
std::cout << "Finish CreatePeerConnectionWithID" << std::endl;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
Params params;
|
Params params;
|
||||||
params.cfg_path = "config\config.ini";
|
params.cfg_path = "/home/zjlab/data/djk/projectx/config/config.ini";
|
||||||
CreatePeerConnection(params);
|
CreatePeerConnection(params);
|
||||||
|
|
||||||
getchar();
|
getchar();
|
||||||
|
|||||||
Reference in New Issue
Block a user