_IpcClient::_IpcClient(void)
: __pReverseSource(null)
, __fdCount(0)
- , __timeout(-1)
, __pFdLock(null)
, __pListener(null)
{
written = write(fd, (char*) pData, remain);
if (written < 0)
{
- SysLogException(NID_IO, E_SYSTEM, "[E_SYSTEM] Failed to send a request: %d, %s", errno, strerror(errno));
-
ReleaseFd(fd);
+
+ if (errno == EAGAIN)
+ {
+ SysLogException(NID_IO, E_RESOURCE_UNAVAILABLE, "[E_RESOURCE_UNAVAILABLE] The socket buffer is full.");
+ return E_RESOURCE_UNAVAILABLE;
+ }
+
+ SysLogException(NID_IO, E_SYSTEM, "[E_SYSTEM] Failed to send a request: %d, %s", errno, strerror(errno));
return E_SYSTEM;
}
written = write(fd, (char*) pData, remain);
if (written < 0)
{
- SysLogException(NID_IO, E_SYSTEM, "[E_SYSTEM] Failed to send a request: %d, %s", errno, strerror(errno));
-
ReleaseFd(fd);
+
+ if (errno == EAGAIN)
+ {
+ SysLogException(NID_IO, E_RESOURCE_UNAVAILABLE, "[E_RESOURCE_UNAVAILABLE] The socket buffer is full.");
+ return E_RESOURCE_UNAVAILABLE;
+ }
+
+ SysLogException(NID_IO, E_SYSTEM, "[E_SYSTEM] Failed to send a request: %d, %s", errno, strerror(errno));
return E_SYSTEM;
}
while (true)
{
- ret = poll(&pfd, 1, __timeout);
+ ret = poll(&pfd, 1, -1);
if (ret < 0)
{
if (errno == EINTR)
ReleaseFd(fd);
return E_SYSTEM;
}
- else if (ret == 0)
- {
- SysLogException(NID_IO, E_TIMEOUT, "[E_TIMEOUT] Timeout.");
-
- ReleaseFd(fd);
- return E_TIMEOUT;
- }
if (pfd.revents & POLLRDHUP)
{
return r;
}
-void
-_IpcClient::SetTimeout(int timeout)
-{
- __timeout = timeout;
-}
-
-int
-_IpcClient::GetTimeout(void) const
-{
- return __timeout;
-}
-
} } //Tizen::Io