Change-Id: Ib699539dd035d3446b100b3dedaf1a1fa3cee872
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
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();
_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) {