mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 15:15:28 +00:00
Reformatting
This commit is contained in:
@ -52,9 +52,9 @@ using future_certificate_ptr = std::shared_future<certificate_ptr>;
|
||||
|
||||
struct DataChannelInit {
|
||||
Reliability reliability = {};
|
||||
string protocol = "";
|
||||
bool negociated = false;
|
||||
std::optional<uint16_t> id = nullopt;
|
||||
string protocol = "";
|
||||
};
|
||||
|
||||
class PeerConnection final : public std::enable_shared_from_this<PeerConnection> {
|
||||
|
@ -106,10 +106,8 @@ typedef struct {
|
||||
} rtcDataChannelInit;
|
||||
|
||||
typedef void(RTC_API *rtcLogCallbackFunc)(rtcLogLevel level, const char *message);
|
||||
typedef void(RTC_API *rtcDescriptionCallbackFunc)(int pc, const char *sdp, const char *type,
|
||||
void *ptr);
|
||||
typedef void(RTC_API *rtcCandidateCallbackFunc)(int pc, const char *cand, const char *mid,
|
||||
void *ptr);
|
||||
typedef void(RTC_API *rtcDescriptionCallbackFunc)(int pc, const char *sdp, const char *type, void *ptr);
|
||||
typedef void(RTC_API *rtcCandidateCallbackFunc)(int pc, const char *cand, const char *mid, void *ptr);
|
||||
typedef void(RTC_API *rtcStateChangeCallbackFunc)(int pc, rtcState state, void *ptr);
|
||||
typedef void(RTC_API *rtcGatheringStateCallbackFunc)(int pc, rtcGatheringState state, void *ptr);
|
||||
typedef void(RTC_API *rtcSignalingStateCallbackFunc)(int pc, rtcSignalingState state, void *ptr);
|
||||
|
@ -331,9 +331,9 @@ int rtcAddDataChannelExt(int pc, const char *label, const rtcDataChannelInit *in
|
||||
int dc = emplaceDataChannel(peerConnection->addDataChannel(
|
||||
string(label ? label : ""),
|
||||
{.reliability = std::move(r),
|
||||
.protocol = init && init->protocol ? init->protocol : "",
|
||||
.negociated = init ? init->negociated : false,
|
||||
.id = init && init->manualId ? std::make_optional(init->id) : nullopt}));
|
||||
.id = init && init->manualId ? std::make_optional(init->id) : nullopt,
|
||||
.protocol = init && init->protocol ? init->protocol : ""}));
|
||||
|
||||
if (auto ptr = getUserPointer(pc))
|
||||
rtcSetUserPointer(dc, *ptr);
|
||||
|
@ -212,10 +212,12 @@ void test_connectivity() {
|
||||
throw runtime_error("Second DataChannel is not open");
|
||||
|
||||
// Try to open a negociated channel
|
||||
auto negociated1 = pc1->createDataChannel("negociated", {.negociated = true, .id = 42});
|
||||
auto negociated2 = pc2->createDataChannel("negoctated", {.negociated = true, .id = 42});
|
||||
auto negociated1 =
|
||||
pc1->createDataChannel("negociated", {.reliability = {}, .negociated = true, .id = 42});
|
||||
auto negociated2 =
|
||||
pc2->createDataChannel("negoctated", {.reliability = {}, .negociated = true, .id = 42});
|
||||
|
||||
if(!negociated1->isOpen() || !negociated2->isOpen())
|
||||
if (!negociated1->isOpen() || !negociated2->isOpen())
|
||||
throw runtime_error("Negociated DataChannel is not open");
|
||||
|
||||
std::atomic<bool> received = false;
|
||||
|
Reference in New Issue
Block a user