[gnome-network-displays/cc-tmp: 41/80] cc: use global CC_MAX_MESSAGE_TIMEOUT




commit eb58246c7e045dc72351cae3258acb8edc8bc272
Author: Anupam Kumar <kyteinsky gmail com>
Date:   Sat Sep 3 17:21:08 2022 +0530

    cc: use global CC_MAX_MESSAGE_TIMEOUT

 src/cc/cc-comm.c | 3 +--
 src/cc/cc-ctrl.c | 4 +++-
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/cc/cc-comm.c b/src/cc/cc-comm.c
index 254cfb1..697a8ae 100644
--- a/src/cc/cc-comm.c
+++ b/src/cc/cc-comm.c
@@ -254,8 +254,7 @@ cc_comm_make_connection (CcComm *comm, gchar *remote_address, GError **error)
       return FALSE;
     }
 
-  // XXX
-  // g_socket_set_timeout (socket, 10);
+  g_socket_set_timeout (socket, CC_MAX_MESSAGE_TIMEOUT);
 
   connectable = g_network_address_parse (remote_address, 8009, error);
   if (connectable == NULL)
diff --git a/src/cc/cc-ctrl.c b/src/cc/cc-ctrl.c
index 7b14193..eaf1ea4 100644
--- a/src/cc/cc-ctrl.c
+++ b/src/cc/cc-ctrl.c
@@ -622,7 +622,9 @@ cc_ctrl_connection_init (CcCtrl *ctrl, gchar *remote_address)
   ctrl->ping_timeout_handle = g_timeout_add_seconds (5, G_SOURCE_FUNC (cc_ctrl_send_ping), ctrl);
 
   // check waiting for every 15 seconds
-  ctrl->waiting_check_timeout_handle = g_timeout_add_seconds (15, G_SOURCE_FUNC (cc_ctrl_check_waiting_for), 
ctrl);
+  ctrl->waiting_check_timeout_handle = g_timeout_add_seconds (CC_MAX_MESSAGE_TIMEOUT,
+                                                              G_SOURCE_FUNC (cc_ctrl_check_waiting_for),
+                                                              ctrl);
 
   // we can skip some message interchange if the mirroring app is already up
   if (!cc_ctrl_send_get_status (ctrl, CC_DEFAULT_RECEIVER_ID, &error))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]