Activate retry count 88/238388/3
authorChanggyu Choi <changyu.choi@samsung.com>
Tue, 14 Jul 2020 01:18:15 +0000 (10:18 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Tue, 14 Jul 2020 01:18:15 +0000 (10:18 +0900)
Change-Id: Ib699539dd035d3446b100b3dedaf1a1fa3cee872
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
aul/socket/client.cc

index 4949dba..4712bd8 100644 (file)
@@ -23,7 +23,7 @@
 
 namespace aul {
 
-Client::Client(std::string path) : Socket(std::move(path)) {
+Client::Client(std::string path) : Socket(std::move(path), true) {
   int retry = 2;
   do {
     int ret = Connect();
@@ -33,12 +33,16 @@ Client::Client(std::string path) : Socket(std::move(path)) {
       _E("Maybe peer not launched or peer dead. path(%s), fd(%d)",
           GetPath().c_str(), GetFd());
       usleep(100 * 1000);
+      --retry;
     } else if (ret < 0) {
       _E("Failed to connect to socket(%s), fd(%d)",
           GetPath().c_str(), GetFd());
       THROW(-ECOMM);
     }
   } while (retry > 0);
+
+  if (retry == 0)
+    THROW(-ECOMM);
 }
 
 int Client::Send(const Packet& packet) {