From 2eb1ed1c08319b974dd87876537b638770b0644f Mon Sep 17 00:00:00 2001 From: "dongkyun.yun" Date: Fri, 25 Nov 2011 14:46:09 +0900 Subject: [PATCH] [Title] Only 10 tries to connect to sdb (sensor_server) [Type] Bugfix [Module] // Module Name - (Main / Sub) [Priority] // Importance : Critical / Major / Minor [CQ#] // CQ Issue Number [Redmine#] // Redmine Isuue Number [Problem] // Problem Description [Cause] // Cause Description [Solution] // Solution Description [TestCase] // Executed the test-target (How to) --- SLP/src/sensor_server.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/SLP/src/sensor_server.c b/SLP/src/sensor_server.c index 7c665c6..0763e5f 100644 --- a/SLP/src/sensor_server.c +++ b/SLP/src/sensor_server.c @@ -187,6 +187,7 @@ static int send_info_to_sensor_daemon(char *send_buf, int buf_size) static void *create_fw_rota_init(void *arg) { int s; + int tries = 0; char fw_buf[64] = {0}; char recv_buf[8] = {0}; char send_buf[32] = {0}; @@ -195,8 +196,14 @@ static void *create_fw_rota_init(void *arg) { s = tcp_socket_outgoing("127.0.0.1", SDB_HOST_PORT); if (s < 0) { - ERR( "can't create socket to talk to the SDB server \n"); - continue; + + ERR("[%d] can't create socket to talk to the SDB server \n", ++tries); + usleep(1000000); + + if(tries > 9) + break; + else + continue; } memset(fw_buf, 0, sizeof(fw_buf)); -- 2.7.4