diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Network.cpp | 18 | ||||
-rw-r--r-- | cpp/src/IcePatch/Server.cpp | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp index c25ed247649..86a45ebe8f1 100644 --- a/cpp/src/Ice/Network.cpp +++ b/cpp/src/Ice/Network.cpp @@ -122,9 +122,11 @@ IceInternal::connectionLost() int error = WSAGetLastError(); return error == WSAECONNRESET || error == WSAESHUTDOWN || + error == WSAENOTCONN || error == WSAECONNABORTED; #else return errno == ECONNRESET || + errno == ENOTCONN || errno == ESHUTDOWN || errno == ECONNABORTED || errno == EPIPE; @@ -211,6 +213,22 @@ IceInternal::shutdownSocket(SOCKET fd) { if(shutdown(fd, SHUT_WR) == SOCKET_ERROR) { + // + // Ignore errors indicating that we are shutdown already. + // +#ifdef _WIN32 + int error = WSAGetLastError(); + if(error == WSAENOTCONN) + { + return; + } +#else + if(errno == ENOTCONN) + { + return; + } +#endif + SocketException ex(__FILE__, __LINE__); ex.error = getSocketErrno(); throw ex; diff --git a/cpp/src/IcePatch/Server.cpp b/cpp/src/IcePatch/Server.cpp index df0ddf5aa3d..ef4def210db 100644 --- a/cpp/src/IcePatch/Server.cpp +++ b/cpp/src/IcePatch/Server.cpp @@ -157,7 +157,7 @@ IcePatch::Updater::run() { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - while(!_destroy) + while(!_destroy && !Application::interrupted()) { try { |