}
}
+static void destroy_scheduled_handle(gpointer data)
+{
+ rpc_port_proxy_tts_h rpc_h = (rpc_port_proxy_tts_h)data;
+ int ret = rpc_port_proxy_tts_destroy(rpc_h);
+ if (RPC_PORT_ERROR_NONE != ret) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to destroy handle. ret(%d/%s)", ret, get_error_message(ret));
+ }
+}
+
+static Eina_Bool destroy_scheduled_handles_by_ecore_idler(void *user_data)
+{
+ SLOG(LOG_INFO, TAG_TTSC, "[INFO] Destroy RPC handles those are scheduled to be destroyed.");
+ g_slist_free_full(g_destruction_scheduled_handles, destroy_scheduled_handle);
+ g_destruction_scheduled_handles = NULL;
+ g_destroy_handles_idler = NULL;
+
+ return EINA_FALSE;
+}
+
+static inline void destroy_rpc_port(tts_tidl_info_s* info)
+{
+ RETM_IF(NULL == info->rpc_h, "[TIDL] Handle is already destroyed");
+
+ g_destruction_scheduled_handles = g_slist_append(g_destruction_scheduled_handles, info->rpc_h);
+ if (NULL == g_destroy_handles_idler) {
+ g_destroy_handles_idler = ecore_idler_add(destroy_scheduled_handles_by_ecore_idler, NULL);
+ }
+
+ info->rpc_h = NULL;
+ info->notify_cb_h = NULL;
+
+ free(info->engine_app_id);
+ info->engine_app_id = NULL;
+
+ info->register_callback_invoked = false;
+ info->connection_requesting = false;
+ info->connected = false;
+}
+
static void __on_connected(rpc_port_proxy_tts_h h, void *user_data)
{
unsigned int uid = (uintptr_t)user_data;
SLOG(LOG_DEBUG, TAG_TTSC, "Disconnected from server");
if (tts_client_is_listening_started(uid)) {
SLOG(LOG_DEBUG, TAG_TTSC, "Try to reconnect to server");
+ destroy_rpc_port(info);
tts_core_handle_service_reset();
}
}
return TTS_ERROR_NONE;
}
-static void destroy_scheduled_handle(gpointer data)
-{
- rpc_port_proxy_tts_h rpc_h = (rpc_port_proxy_tts_h)data;
- int ret = rpc_port_proxy_tts_destroy(rpc_h);
- if (RPC_PORT_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to destroy handle. ret(%d/%s)", ret, get_error_message(ret));
- }
-}
-
-static Eina_Bool destroy_scheduled_handles_by_ecore_idler(void *user_data)
-{
- SLOG(LOG_INFO, TAG_TTSC, "[INFO] Destroy RPC handles those are scheduled to be destroyed.");
- g_slist_free_full(g_destruction_scheduled_handles, destroy_scheduled_handle);
- g_destruction_scheduled_handles = NULL;
- g_destroy_handles_idler = NULL;
-
- return EINA_FALSE;
-}
-
-static inline void destroy_rpc_port(tts_tidl_info_s* info)
-{
- RETM_IF(NULL == info->rpc_h, "[TIDL] Handle is already destroyed");
-
- g_destruction_scheduled_handles = g_slist_append(g_destruction_scheduled_handles, info->rpc_h);
- if (NULL == g_destroy_handles_idler) {
- g_destroy_handles_idler = ecore_idler_add(destroy_scheduled_handles_by_ecore_idler, NULL);
- }
-
- info->rpc_h = NULL;
- info->notify_cb_h = NULL;
-
- free(info->engine_app_id);
- info->engine_app_id = NULL;
-
- info->register_callback_invoked = false;
- info->connection_requesting = false;
- info->connected = false;
-}
-
int tts_tidl_close_connection(unsigned int uid)
{
SLOG(LOG_DEBUG, TAG_TTSC, "[TIDL] tts_tidl_close_connection");