mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 12:45:35 +08:00
Modify interface
This commit is contained in:
@@ -19,7 +19,7 @@ PeerConnection::PeerConnection() {}
|
||||
|
||||
PeerConnection::~PeerConnection() {}
|
||||
|
||||
int PeerConnection::Init(Params params) {
|
||||
int PeerConnection::Init(PeerConnectionParams params) {
|
||||
INIReader reader(params.cfg_path);
|
||||
std::string cfg_signal_server_ip = reader.Get("signal server", "ip", "-1");
|
||||
std::string cfg_signal_server_port =
|
||||
@@ -78,7 +78,7 @@ int PeerConnection::Init(Params params) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int PeerConnection::Init(Params params, std::string const &id) {
|
||||
int PeerConnection::Init(PeerConnectionParams params, std::string const &id) {
|
||||
INIReader reader(params.cfg_path);
|
||||
std::string cfg_signal_server_ip = reader.Get("signal server", "ip", "-1");
|
||||
std::string cfg_signal_server_port =
|
||||
|
||||
@@ -8,26 +8,25 @@
|
||||
|
||||
enum SignalStatus { Connecting = 0, Connected, Closed };
|
||||
|
||||
typedef void (*OnReceiveBuffer)(unsigned char *, size_t, const char *,
|
||||
const size_t);
|
||||
|
||||
typedef void (*NetStatusReport)(const unsigned short, const unsigned short);
|
||||
|
||||
typedef struct {
|
||||
const char *cfg_path;
|
||||
OnReceiveBuffer on_receive_buffer;
|
||||
NetStatusReport net_status_report;
|
||||
} PeerConnectionParams;
|
||||
|
||||
class PeerConnection {
|
||||
public:
|
||||
typedef void (*OnReceiveBuffer)(unsigned char *, size_t, const char *,
|
||||
const size_t);
|
||||
|
||||
typedef void (*NetStatusReport)(const unsigned short, const unsigned short);
|
||||
|
||||
typedef struct {
|
||||
const char *cfg_path;
|
||||
OnReceiveBuffer on_receive_buffer;
|
||||
NetStatusReport net_status_report;
|
||||
} Params;
|
||||
|
||||
public:
|
||||
PeerConnection();
|
||||
~PeerConnection();
|
||||
|
||||
public:
|
||||
int Init(Params params);
|
||||
int Init(Params params, std::string const &id);
|
||||
int Init(PeerConnectionParams params);
|
||||
int Init(PeerConnectionParams params, std::string const &id);
|
||||
int Destroy();
|
||||
|
||||
SignalStatus GetSignalStatus();
|
||||
|
||||
Reference in New Issue
Block a user