m_sock_fd, buffer, total_sent_size, size, total_sent_size,
len, get_client_name());
+ /*
+ * If socket is not available to use it temporarily,
+ * EAGAIN(EWOULDBLOCK) is returned by ::send().
+ * so in order to prevent that data are omitted, retry to send it
+ */
+ if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
+ usleep(1000);
+ continue;
+ }
+
if (errno != EINTR) {
err = errno;
break;
m_sock_fd, buffer, total_recv_size, size, total_recv_size,
len, get_client_name());
+ /*
+ * If socket is not available to use during for some time,
+ * EAGAIN(EWOULDBLOCK) is returned by ::recv().
+ * so in order to prevent that data are omitted, retry to receive it
+ */
+ if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
+ usleep(1000);
+ continue;
+ }
+
if (errno != EINTR) {
err = errno;
break;