mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-23 07:35:30 +00:00
Added custom MTU and STUN server to C API connectivity test
This commit is contained in:
@ -181,13 +181,17 @@ int test_capi_connectivity_main() {
|
|||||||
|
|
||||||
rtcInitLogger(RTC_LOG_DEBUG, nullptr);
|
rtcInitLogger(RTC_LOG_DEBUG, nullptr);
|
||||||
|
|
||||||
|
// STUN server example (not necessary to connect locally)
|
||||||
|
// Please do not use outside of libdatachannel tests
|
||||||
|
const char *iceServers[1] = {"stun:stun.ageneau.net:3478"};
|
||||||
|
|
||||||
// Create peer 1
|
// Create peer 1
|
||||||
rtcConfiguration config1;
|
rtcConfiguration config1;
|
||||||
memset(&config1, 0, sizeof(config1));
|
memset(&config1, 0, sizeof(config1));
|
||||||
// STUN server example
|
config1.iceServers = iceServers;
|
||||||
// const char *iceServers[1] = {"stun:stun.l.google.com:19302"};
|
config1.iceServersCount = 1;
|
||||||
// config1.iceServers = iceServers;
|
// Custom MTU example
|
||||||
// config1.iceServersCount = 1;
|
config1.mtu = 1500;
|
||||||
|
|
||||||
peer1 = createPeer(&config1);
|
peer1 = createPeer(&config1);
|
||||||
if (!peer1)
|
if (!peer1)
|
||||||
@ -196,9 +200,12 @@ int test_capi_connectivity_main() {
|
|||||||
// Create peer 2
|
// Create peer 2
|
||||||
rtcConfiguration config2;
|
rtcConfiguration config2;
|
||||||
memset(&config2, 0, sizeof(config2));
|
memset(&config2, 0, sizeof(config2));
|
||||||
// STUN server example
|
// STUN server example (not necessary to connect locally)
|
||||||
// config2.iceServers = iceServers;
|
// Please do not use outside of libdatachannel tests
|
||||||
// config2.iceServersCount = 1;
|
config2.iceServers = iceServers;
|
||||||
|
config2.iceServersCount = 1;
|
||||||
|
// Custom MTU example
|
||||||
|
config2.mtu = 1500;
|
||||||
// Port range example
|
// Port range example
|
||||||
config2.portRangeBegin = 5000;
|
config2.portRangeBegin = 5000;
|
||||||
config2.portRangeEnd = 6000;
|
config2.portRangeEnd = 6000;
|
||||||
|
Reference in New Issue
Block a user