From: GiWoong Kim Date: Wed, 9 Apr 2014 05:48:59 +0000 (+0900) Subject: communication: modified hb signal period X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~415 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8759550a183a2e2644ae7ca8a86e6db95003a07d;p=sdk%2Femulator%2Fqemu.git communication: modified hb signal period The initial period of HB signal needs a bit tuning in case of low performance machine. Change-Id: I08274b7ea6526aea9d356e5474bd0aa08236922a Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/skin/maruskin_server.c b/tizen/src/skin/maruskin_server.c index 718ec33917..f3168f7613 100644 --- a/tizen/src/skin/maruskin_server.c +++ b/tizen/src/skin/maruskin_server.c @@ -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) {