From e359cab53dd4031b08b3cd6effada1dd0edac404 Mon Sep 17 00:00:00 2001 From: Sunwook Bae Date: Wed, 24 Jul 2013 19:53:21 +0900 Subject: [PATCH] Add an E_INVALID_CONNECTION in _IpcClient::SendRequest() Change-Id: I16423865db3bac8f9fc13f834ce253f1a2af1642 Signed-off-by: Sunwook Bae --- src/io/FIo_IpcClient.cpp | 10 ++++++++++ src/io/inc/FIo_IpcClient.h | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/io/FIo_IpcClient.cpp b/src/io/FIo_IpcClient.cpp index 6e4417e..d13f7ec 100644 --- a/src/io/FIo_IpcClient.cpp +++ b/src/io/FIo_IpcClient.cpp @@ -502,6 +502,11 @@ _IpcClient::SendAsync(IPC::Message* pMessage) SysLogException(NID_IO, E_RESOURCE_UNAVAILABLE, "[E_RESOURCE_UNAVAILABLE] The socket buffer is full."); return E_RESOURCE_UNAVAILABLE; } + else if (errno == EPIPE) + { + SysLogException(NID_IO, E_INVALID_CONNECTION, "[E_INVALID_CONNECTION] The socket connection is closed."); + return E_INVALID_CONNECTION; + } SysLogException(NID_IO, E_SYSTEM, "[E_SYSTEM] Failed to send a request: %d, %s", errno, strerror(errno)); return E_SYSTEM; @@ -558,6 +563,11 @@ _IpcClient::SendSync(IPC::Message* pMessage) SysLogException(NID_IO, E_RESOURCE_UNAVAILABLE, "[E_RESOURCE_UNAVAILABLE] The socket buffer is full."); return E_RESOURCE_UNAVAILABLE; } + else if (errno == EPIPE) + { + SysLogException(NID_IO, E_INVALID_CONNECTION, "[E_INVALID_CONNECTION] The socket connection is closed."); + return E_INVALID_CONNECTION; + } SysLogException(NID_IO, E_SYSTEM, "[E_SYSTEM] Failed to send a request: %d, %s", errno, strerror(errno)); return E_SYSTEM; diff --git a/src/io/inc/FIo_IpcClient.h b/src/io/inc/FIo_IpcClient.h index 7616838..2a6a062 100644 --- a/src/io/inc/FIo_IpcClient.h +++ b/src/io/inc/FIo_IpcClient.h @@ -68,7 +68,6 @@ public: * @param[in] pListener Set if the client want to handle a message from the IPC server. * @c null, otherwise. * @exception E_SUCCESS The method was successful. - * @exception E_OBJ_NOT_FOUND The IPC server was not found. * @exception E_OUT_OF_MEMORY Insufficient memory. * @exception E_SYSTEM A system error occurred. */ @@ -102,8 +101,8 @@ public: * @return An error code * @param[in] message The message to send * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_STATE The instance is in an invalid state. * @exception E_RESOURCE_UNAVAILABLE The socket buffer is full. + * @exception E_INVALID_CONNECTION The socket connection is closed. * @exception E_OUT_OF_MEMORY Insufficient memory. * @exception E_SYSTEM A system error occurred. * -- 2.7.4