From: Changgyu Choi Date: Tue, 14 Jul 2020 01:18:15 +0000 (+0900) Subject: Activate retry count X-Git-Tag: submit/tizen/20200714.005539~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=278f12c6ca16327392b6b17b4a6390c120f14687;p=platform%2Fcore%2Fappfw%2Faul-1.git Activate retry count Change-Id: Ib699539dd035d3446b100b3dedaf1a1fa3cee872 Signed-off-by: Changgyu Choi --- diff --git a/aul/socket/client.cc b/aul/socket/client.cc index 4949dba..4712bd8 100644 --- a/aul/socket/client.cc +++ b/aul/socket/client.cc @@ -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) {