Skip to content

Commit

Permalink
[core] Marked bonding experimental (#1563)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethouris committed Sep 22, 2020
1 parent 47216f3 commit 39916e0
Show file tree
Hide file tree
Showing 16 changed files with 282 additions and 46 deletions.
15 changes: 13 additions & 2 deletions CMakeLists.txt
Expand Up @@ -106,6 +106,7 @@ endif()
option(CYGWIN_USE_POSIX "Should the POSIX API be used for cygwin. Ignored if the system isn't cygwin." OFF)
option(ENABLE_CXX11 "Should the c++11 parts (srt-live-transmit) be enabled" ON)
option(ENABLE_APPS "Should the Support Applications be Built?" ON)
option(ENABLE_EXPERIMENTAL_BONDING "Should the EXPERIMENTAL bonding functionality be enabled?" OFF)
option(ENABLE_TESTING "Should the Developer Test Applications be Built?" OFF)
option(ENABLE_PROFILE "Should instrument the code for profiling. Ignored for non-GNU compiler." $ENV{HAI_BUILD_PROFILE})
option(ENABLE_LOGGING "Should logging be enabled" ON)
Expand Down Expand Up @@ -611,6 +612,10 @@ if (ENABLE_GETNAMEINFO)
list(APPEND SRT_EXTRA_CFLAGS "-DENABLE_GETNAMEINFO=1")
endif()

if (ENABLE_EXPERIMENTAL_BONDING)
list(APPEND SRT_EXTRA_CFLAGS "-DENABLE_EXPERIMENTAL_BONDING=1")
endif()

if (ENABLE_THREAD_CHECK)
add_definitions(
-DSRT_ENABLE_THREADCHECK=1
Expand Down Expand Up @@ -772,6 +777,8 @@ MafReadDir(srtcore filelist.maf
PRIVATE_HEADERS HEADERS_srt_private
)

message(STATUS "SRT Sources: ${SOURCES_srt}")

# Auto generated version file and add it to the HEADERS_srt list.
if(DEFINED ENV{APPVEYOR_BUILD_NUMBER})
set(SRT_VERSION_BUILD ON)
Expand Down Expand Up @@ -1124,8 +1131,10 @@ if (ENABLE_APPS)
srt_add_testprogram(srt-test-multiplex)
srt_make_application(srt-test-multiplex)

srt_add_testprogram(srt-test-mpbond)
srt_make_application(srt-test-mpbond)
if (ENABLE_EXPERIMENTAL_BONDING)
srt_add_testprogram(srt-test-mpbond)
srt_make_application(srt-test-mpbond)
endif()

else()
message(STATUS "DEVEL APPS (testing): DISABLED")
Expand Down Expand Up @@ -1159,11 +1168,13 @@ if (ENABLE_EXAMPLES)
srt_add_example(test-c-server.c)
srt_make_application(test-c-server)

if (ENABLE_EXPERIMENTAL_BONDING)
srt_add_example(test-c-client-bonding.c)
srt_make_application(test-c-client-bonding)

srt_add_example(test-c-server-bonding.c)
srt_make_application(test-c-server-bonding)
endif()

srt_add_example(testcapi-connect.c)
target_link_libraries(testcapi-connect ${srt_link_library} ${DEPENDS_srt})
Expand Down
6 changes: 6 additions & 0 deletions apps/socketoptions.hpp
Expand Up @@ -70,11 +70,13 @@ inline int SocketOption::setso<SocketOption::SRT, int>(int socket, int /*ignored
return srt_setsockopt(socket, 0, SRT_SOCKOPT(sym), data, (int) size);
}

#if ENABLE_EXPERIMENTAL_BONDING
template<>
inline int SocketOption::setso<SocketOption::SRT, SRT_SOCKOPT_CONFIG*>(SRT_SOCKOPT_CONFIG* obj, int /*ignored*/, int sym, const void* data, size_t size)
{
return srt_config_add(obj, SRT_SOCKOPT(sym), data, (int) size);
}
#endif


template<>
Expand Down Expand Up @@ -244,11 +246,15 @@ const SocketOption srt_options [] {
{ "ipv6only", 0, SRTO_IPV6ONLY, SocketOption::PRE, SocketOption::INT, nullptr },
{ "peeridletimeo", 0, SRTO_PEERIDLETIMEO, SocketOption::PRE, SocketOption::INT, nullptr },
{ "packetfilter", 0, SRTO_PACKETFILTER, SocketOption::PRE, SocketOption::STRING, nullptr },
#if ENABLE_EXPERIMENTAL_BONDING
{ "groupconnect", 0, SRTO_GROUPCONNECT, SocketOption::PRE, SocketOption::INT, nullptr},
#endif
#ifdef SRT_ENABLE_BINDTODEVICE
{ "bindtodevice", 0, SRTO_BINDTODEVICE, SocketOption::PRE, SocketOption::STRING, nullptr},
#endif
#if ENABLE_EXPERIMENTAL_BONDING
{ "groupstabtimeo", 0, SRTO_GROUPSTABTIMEO, SocketOption::PRE, SocketOption::INT, nullptr},
#endif
{ "retransmitalgo", 0, SRTO_RETRANSMITALGO, SocketOption::PRE, SocketOption::INT, nullptr }
};
}
Expand Down

0 comments on commit 39916e0

Please sign in to comment.