This pull request introduces several changes to the TEN framework, primarily focusing on enhancing protocol handling and adding a retry mechanism. The most important changes include modifications to protocol function signatures, addition of retry configurations, and updates to timer functionalities.
Protocol Handling Enhancements:
core/include/ten_runtime/protocol/protocol.h: Modified the ten_protocol_listen_func_t and ten_protocol_connect_to_func_t function signatures to include callback parameters for client acceptance and server connection.
core/include_internal/ten_runtime/protocol/protocol.h: Removed the callback function pointers on_client_accepted and on_server_connected from the ten_protocol_t struct. Updated the ten_protocol_listen and ten_protocol_connect_to functions to reflect the new signatures. [1][2]
This pull request introduces several changes to the TEN framework, primarily focusing on enhancing protocol handling and adding a retry mechanism. The most important changes include modifications to protocol function signatures, addition of retry configurations, and updates to timer functionalities.
Protocol Handling Enhancements:
core/include/ten_runtime/protocol/protocol.h
: Modified theten_protocol_listen_func_t
andten_protocol_connect_to_func_t
function signatures to include callback parameters for client acceptance and server connection.core/include_internal/ten_runtime/protocol/protocol.h
: Removed the callback function pointerson_client_accepted
andon_server_connected
from theten_protocol_t
struct. Updated theten_protocol_listen
andten_protocol_connect_to
functions to reflect the new signatures. [1] [2]Retry Mechanism:
core/include_internal/ten_runtime/protocol/integrated/retry.h
: Added a new header file defining theten_protocol_integrated_retry_config_t
struct and its initialization function.core/include_internal/ten_runtime/protocol/integrated/protocol_integrated.h
: Included the retry configuration and timer in theten_protocol_integrated_t
struct. Added functions to create and destroy connection context with retry support. [1] [2]Timer Functionality:
core/include_internal/ten_runtime/timer/timer.h
: Added aresettable
flag to theten_timer_t
struct and updated theten_timer_create
function to include this flag. [1] [2]core/src/ten_runtime/extension/internal/path_timer.c
: Updated timer creation functions to include theresettable
flag set tofalse
. [1] [2]Additional Changes:
core/include_internal/ten_runtime/protocol/integrated/close.h
: Added a new functionten_protocol_integrated_on_close
to handle protocol closure.core/src/ten_runtime/protocol/integrated/close.c
: Updated the protocol closure logic to handle the retry timer. [1] [2] [3] [4]These changes collectively improve the robustness and flexibility of protocol management within the TEN framework.