return NULL;
}
-static void __reconnect(void *data)
-{
- unsigned int uid = (uintptr_t)data;
-
- tts_client_s *client = tts_client_get_by_uid(uid);
- if (!client)
- return;
-
- for (int nsec = 1; nsec <= MAXSLEEP; nsec <<= 1) {
- if (0 == tts_tidl_open_connection(uid)) {
- SLOG(LOG_DEBUG, TAG_TTSC, "Try to connect the service");
- return;
- }
-
- if (nsec <= MAXSLEEP/2)
- sleep(nsec);
-
- SLOG(LOG_DEBUG, TAG_TTSC, "Retrying...");
- }
- return;
-}
-
static void __notify_cb(void *user_data, int pid, int uid, bundle *msg)
{
char *method = NULL;
info->connected = false;
info->connection_requesting = false;
info->register_callback_invoked = false;
- if (tts_client_is_listening_started(uid)) {
- tts_core_handle_service_reset();
- SLOG(LOG_DEBUG, TAG_TTSC, "Disconnected from server");
- ecore_main_loop_thread_safe_call_async(__reconnect, 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");
+ tts_core_handle_service_reset();
}
}