From: InHong Han Date: Thu, 12 Oct 2017 08:53:23 +0000 (+0900) Subject: Retry socket connection of remote_control to prevent abort issue X-Git-Tag: accepted/tizen/unified/20171018.062657~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90d1f3e09391e8e8c87c8aad8b96ba951fa8678f;p=platform%2Fcore%2Fuifw%2Fisf.git Retry socket connection of remote_control to prevent abort issue Change-Id: I22cdde585e4b985e5f03d38b0b4efa17d79752cc --- diff --git a/ism/src/isf_remote_client.cpp b/ism/src/isf_remote_client.cpp index 4712be8..ed1ead7 100644 --- a/ism/src/isf_remote_client.cpp +++ b/ism/src/isf_remote_client.cpp @@ -38,6 +38,8 @@ #endif #define LOG_TAG "ISF_REMOTE_CLIENT" +#define RETRY_COUNT 5 + namespace scim { @@ -233,10 +235,15 @@ public: return true; } - bool has_pending_event (void) const { + bool has_pending_event (void) { if (m_socket_panel2remoteinput.is_connected () && m_socket_panel2remoteinput.wait_for_data (0) > 0) return true; + for (int i = 0; i < RETRY_COUNT; ++i) { + if (open_connection()) + return true; + } + return false; } @@ -313,8 +320,12 @@ public: } remote_control_callback_type recv_callback_message(void) { - if (! m_socket_panel2remoteinput.is_connected () || ! m_trans_recv.read_from_socket(m_socket_panel2remoteinput, m_socket_timeout)) - return REMOTE_CONTROL_CALLBACK_ERROR; + if (! m_socket_panel2remoteinput.is_connected () || ! m_trans_recv.read_from_socket(m_socket_panel2remoteinput, m_socket_timeout)) { + for (int i = 0; i < RETRY_COUNT; ++i) { + if (open_connection()) + break; + } + } int cmd;