Increse socket timeout for client 80/304280/4
authorIlho Kim <ilho159.kim@samsung.com>
Mon, 15 Jan 2024 09:59:38 +0000 (18:59 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Mon, 15 Jan 2024 10:11:33 +0000 (19:11 +0900)
Change-Id: I00e441d95a522b2c46ba5205aef166219ef508e1
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/socket/abstract_socket.cc

index 9dca341..02ef6d4 100644 (file)
@@ -62,6 +62,7 @@ int AbstractSocket::SendData(const void* buf, unsigned int size) {
 int AbstractSocket::ReceiveData(void* buf, unsigned int size) {
   bool is_blocking = true;
   int retry_count = 20;
+  int block_retry_count = 5;
 
   if (fcntl(fd_, F_GETFL, 0) & O_NONBLOCK)
     is_blocking = false;
@@ -81,7 +82,12 @@ int AbstractSocket::ReceiveData(void* buf, unsigned int size) {
         continue;
       } else if (errno == EAGAIN) {
         if (is_blocking) {
-          LOG(ERROR) << "Timed out. fd: " << fd_ << ", errno: " << EAGAIN;
+          LOG(ERROR) << "Timed out. fd: " << fd_ << ", errno: " << EAGAIN
+              << " remaining retry count : " << block_retry_count;
+          if (block_retry_count > 0) {
+            block_retry_count--;
+            continue;
+          }
           return -EAGAIN;
         }