mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
Use user id instead of ice username
This commit is contained in:
@@ -1,38 +1,39 @@
|
||||
#ifndef _X_H_
|
||||
#define _X_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
enum ws_status { WS_CONNECTING = 0, WS_OPEN, WS_FAILED, WS_CLOSED, WS_UNKNOWN };
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct Peer PeerPtr;
|
||||
|
||||
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;
|
||||
|
||||
PeerPtr* CreatePeer(const Params* params);
|
||||
|
||||
int CreateConnection(PeerPtr* peer_ptr);
|
||||
|
||||
int JoinConnection(PeerPtr* peer_ptr, const char* connection_id);
|
||||
|
||||
int SendData(PeerPtr* peer_ptr, const char* data, size_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef _X_H_
|
||||
#define _X_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
enum ws_status { WS_CONNECTING = 0, WS_OPEN, WS_FAILED, WS_CLOSED, WS_UNKNOWN };
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct Peer PeerPtr;
|
||||
|
||||
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;
|
||||
|
||||
PeerPtr* CreatePeer(const Params* params);
|
||||
|
||||
int CreateConnection(PeerPtr* peer_ptr);
|
||||
|
||||
int JoinConnection(PeerPtr* peer_ptr, const char* transmission_id,
|
||||
const char* user_id);
|
||||
|
||||
int SendData(PeerPtr* peer_ptr, const char* data, size_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user