#endif
#define LOG_TAG "ISF_REMOTE_CLIENT"
+#define RETRY_COUNT 5
+
namespace scim
{
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;
}
}
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;