Change-Id: I00e441d95a522b2c46ba5205aef166219ef508e1
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
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;
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;
}