From: InHong Han Date: Tue, 20 Dec 2016 08:22:13 +0000 (+0900) Subject: Modified open_connection logic when the helper_active connection is failed X-Git-Tag: submit/tizen_3.0/20161221.132031~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15dfdaed179fe03dfca73079de2d5e93eb58201a;p=platform%2Fcore%2Fuifw%2Fisf.git Modified open_connection logic when the helper_active connection is failed Change-Id: I2f6585c8de65939af5907c26b0600612e86bf181 --- diff --git a/ism/src/scim_helper.cpp b/ism/src/scim_helper.cpp index cd77f26b..629f700c 100644 --- a/ism/src/scim_helper.cpp +++ b/ism/src/scim_helper.cpp @@ -705,14 +705,30 @@ HelperAgent::open_connection (const HelperInfo &info, /* connect to the panel agent as the active helper client */ if (!m_impl->socket_active.connect (address)) return -1; - if (!scim_socket_open_connection (magic, + open_connection_retries = 0; + while (!scim_socket_open_connection (magic, String ("Helper_Active"), String ("Panel"), m_impl->socket_active, timeout)) { - m_impl->socket_active.close (); - ISF_SAVE_LOG ("Helper_Active scim_socket_open_connection() failed %d\n", timeout); - return -1; + if (++open_connection_retries > 10) { + m_impl->socket_active.close (); + std::cerr << "Helper_Active scim_socket_open_connection () is failed!!!\n"; + ISF_LOG ("Helper_Active scim_socket_open_connection () is failed!!!\n"); + ISF_SAVE_LOG ("Helper_Active scim_socket_open_connection failed, %d\n", timeout); + + return -1; + } + + /* Retry after re-connecting the socket */ + if (m_impl->socket_active.is_connected ()) + m_impl->socket_active.close (); + + /* This time, just retry atmost 2 seconds */ + i = 0; + while (!m_impl->socket_active.connect (address) && ++i < 10) { + scim_usleep (200000); + } } m_impl->magic_active = magic;