communication: modified hb signal period 59/19359/1
authorGiWoong Kim <giwoong.kim@samsung.com>
Wed, 9 Apr 2014 05:48:59 +0000 (14:48 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Fri, 11 Apr 2014 06:31:20 +0000 (15:31 +0900)
The initial period of HB signal needs a bit tuning
in case of low performance machine.

Change-Id: I08274b7ea6526aea9d356e5474bd0aa08236922a
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/maruskin_server.c

index 718ec33917484a75efc1ccc705fdc896f7c0efd2..f3168f761387876826f0241925c5fe7d784b7790 100644 (file)
@@ -706,8 +706,14 @@ static void* run_skin_server(void* args)
             break;
         }
 
+        if (client_sock != 0) {
+            SOCKET_CLOSE(client_sock);
+        }
+
         ready_server = 1;
 
+        INFO("start accepting socket...\n");
+
         if (!is_started_heartbeat) {
             if (!start_heart_beat()) {
                 ERR("Fail to start heartbeat thread.\n");
@@ -717,12 +723,6 @@ static void* run_skin_server(void* args)
             }
         }
 
-        if (client_sock != 0) {
-            SOCKET_CLOSE(client_sock);
-        }
-
-        INFO("start accepting socket...\n");
-
         if (0 > (client_sock = accept(
             server_sock, (struct sockaddr *) &client_addr, &client_len)))
         {
@@ -1352,7 +1352,7 @@ static void* do_heart_beat(void* args)
     int shutdown = 0;
 
     unsigned int booting_handicap_cnt = 0;
-    unsigned int hb_interval = HEART_BEAT_INTERVAL * 1000;
+    const unsigned int hb_interval = HEART_BEAT_INTERVAL * 1000;
 
     while (1) {
         if (booting_handicap_cnt < 5) {
@@ -1379,7 +1379,9 @@ static void* do_heart_beat(void* args)
         } else {
             /* fail to get socket in accepting or client is not yet accepted */
             send_fail_count++;
-            TRACE("[HB] client socket is NULL yet.\n");
+            INFO("[HB] client socket is not ready yet.\n");
+
+            SLEEP(hb_interval); /* 1sec */
         }
 
         if ((HEART_BEAT_FAIL_COUNT + 1) < send_fail_count) {