Skip to content

Commit

Permalink
Replace ConnectionTimeoutException by ConnectionIdleException
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier committed Apr 26, 2024
1 parent 136370e commit dbba5d6
Show file tree
Hide file tree
Showing 15 changed files with 169 additions and 168 deletions.
18 changes: 9 additions & 9 deletions cpp/include/Ice/LocalException.h
Original file line number Diff line number Diff line change
Expand Up @@ -1291,10 +1291,10 @@ namespace Ice
};

/**
* This exception indicates a timeout condition.
* This exception indicates that a connection was aborted by the idle check.
* \headerfile Ice/Ice.h
*/
class ICE_API TimeoutException : public LocalException
class ICE_API ConnectionIdleException : public LocalException
{
public:
using LocalException::LocalException;
Expand All @@ -1311,13 +1311,13 @@ namespace Ice
};

/**
* This exception indicates a connection establishment timeout condition.
* This exception indicates a timeout condition.
* \headerfile Ice/Ice.h
*/
class ICE_API ConnectTimeoutException : public TimeoutException
class ICE_API TimeoutException : public LocalException
{
public:
using TimeoutException::TimeoutException;
using LocalException::LocalException;

/**
* Obtains the Slice type ID of this exception.
Expand All @@ -1331,10 +1331,10 @@ namespace Ice
};

/**
* This exception indicates a connection closure timeout condition.
* This exception indicates a connection establishment timeout condition.
* \headerfile Ice/Ice.h
*/
class ICE_API CloseTimeoutException : public TimeoutException
class ICE_API ConnectTimeoutException : public TimeoutException
{
public:
using TimeoutException::TimeoutException;
Expand All @@ -1351,10 +1351,10 @@ namespace Ice
};

/**
* This exception indicates that a connection has been shut down because it has been idle for some time.
* This exception indicates a connection closure timeout condition.
* \headerfile Ice/Ice.h
*/
class ICE_API ConnectionTimeoutException : public TimeoutException
class ICE_API CloseTimeoutException : public TimeoutException
{
public:
using TimeoutException::TimeoutException;
Expand Down
15 changes: 7 additions & 8 deletions cpp/src/Ice/ConnectionI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, exc
{
rethrow_exception(ex);
}
catch (const Ice::ConnectionTimeoutException&)
catch (const ConnectionIdleException&)
{
setState(StateClosed, ex);
}
Expand Down Expand Up @@ -939,7 +939,7 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, exc
{
rethrow_exception(ex);
}
catch (const Ice::ConnectionTimeoutException&)
catch (const ConnectionIdleException&)
{
setState(StateClosed, ex);
}
Expand All @@ -964,7 +964,7 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, exc
{
rethrow_exception(ex);
}
catch (const Ice::ConnectionTimeoutException&)
catch (const ConnectionIdleException&)
{
setState(StateClosed, ex);
}
Expand Down Expand Up @@ -1659,7 +1659,7 @@ Ice::ConnectionI::finish(bool close)
catch (const ConnectionManuallyClosedException&)
{
}
catch (const ConnectionTimeoutException&)
catch (const ConnectionIdleException&)
{
}
catch (const CommunicatorDestroyedException&)
Expand Down Expand Up @@ -2000,7 +2000,7 @@ Ice::ConnectionI::setState(State state, exception_ptr ex)
catch (const ConnectionManuallyClosedException&)
{
}
catch (const ConnectionTimeoutException&)
catch (const ConnectionIdleException&)
{
}
catch (const CommunicatorDestroyedException&)
Expand Down Expand Up @@ -2178,7 +2178,7 @@ Ice::ConnectionI::setState(State state)
catch (const ConnectionManuallyClosedException&)
{
}
catch (const ConnectionTimeoutException&)
catch (const ConnectionIdleException&)
{
}
catch (const CommunicatorDestroyedException&)
Expand Down Expand Up @@ -2303,8 +2303,7 @@ Ice::ConnectionI::idleCheck(
out << _transceiver->toDetailedString();
}

// TODO: replace by ConnectionIdleException.
setState(StateClosed, make_exception_ptr(TimeoutException(__FILE__, __LINE__)));
setState(StateClosed, make_exception_ptr(ConnectionIdleException(__FILE__, __LINE__)));
}
}
// else, nothing to do
Expand Down
38 changes: 19 additions & 19 deletions cpp/src/Ice/LocalException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,54 +484,54 @@ Ice::OperationInterruptedException::ice_staticId() noexcept
}

string
Ice::TimeoutException::ice_id() const
Ice::ConnectionIdleException::ice_id() const
{
return string{ice_staticId()};
}

string_view
Ice::TimeoutException::ice_staticId() noexcept
Ice::ConnectionIdleException::ice_staticId() noexcept
{
static constexpr string_view typeId = "::Ice::TimeoutException";
static constexpr string_view typeId = "::Ice::ConnectionIdleException";
return typeId;
}

string
Ice::ConnectTimeoutException::ice_id() const
Ice::TimeoutException::ice_id() const
{
return string{ice_staticId()};
}

string_view
Ice::ConnectTimeoutException::ice_staticId() noexcept
Ice::TimeoutException::ice_staticId() noexcept
{
static constexpr string_view typeId = "::Ice::ConnectTimeoutException";
static constexpr string_view typeId = "::Ice::TimeoutException";
return typeId;
}

string
Ice::CloseTimeoutException::ice_id() const
Ice::ConnectTimeoutException::ice_id() const
{
return string{ice_staticId()};
}

string_view
Ice::CloseTimeoutException::ice_staticId() noexcept
Ice::ConnectTimeoutException::ice_staticId() noexcept
{
static constexpr string_view typeId = "::Ice::CloseTimeoutException";
static constexpr string_view typeId = "::Ice::ConnectTimeoutException";
return typeId;
}

string
Ice::ConnectionTimeoutException::ice_id() const
Ice::CloseTimeoutException::ice_id() const
{
return string{ice_staticId()};
}

string_view
Ice::ConnectionTimeoutException::ice_staticId() noexcept
Ice::CloseTimeoutException::ice_staticId() noexcept
{
static constexpr string_view typeId = "::Ice::ConnectionTimeoutException";
static constexpr string_view typeId = "::Ice::CloseTimeoutException";
return typeId;
}

Expand Down Expand Up @@ -1124,6 +1124,13 @@ Ice::OperationInterruptedException::ice_print(ostream& out) const
out << ":\noperation interrupted";
}

void
Ice::ConnectionIdleException::ice_print(ostream& out) const
{
Exception::ice_print(out);
out << ":\nconnection was aborted by the idle check";
}

void
Ice::TimeoutException::ice_print(ostream& out) const
{
Expand All @@ -1145,13 +1152,6 @@ Ice::CloseTimeoutException::ice_print(ostream& out) const
out << ":\ntimeout while closing a connection";
}

void
Ice::ConnectionTimeoutException::ice_print(ostream& out) const
{
Exception::ice_print(out);
out << ":\nconnection has timed out";
}

void
Ice::InvocationTimeoutException::ice_print(ostream& out) const
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/Ice/idleTimeout/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ testEnableDisableIdleCheck(bool enabled, const string& proxyString, const Proper
p->sleep(2000); // the implementation in the server sleeps for 2,000ms
test(!enabled);
}
catch (const TimeoutException&)
catch (const ConnectionIdleException&)
{
test(enabled);
}
Expand Down
28 changes: 14 additions & 14 deletions js/src/Ice/LocalException.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,9 +803,9 @@ Ice.OperationInterruptedException = class extends Ice.LocalException
};

/**
* This exception indicates a timeout condition.
* This exception indicates that a connection was aborted by the idle check.
**/
Ice.TimeoutException = class extends Ice.LocalException
Ice.ConnectionIdleException = class extends Ice.LocalException
{
constructor(_cause = "")
{
Expand All @@ -814,19 +814,19 @@ Ice.TimeoutException = class extends Ice.LocalException

static get _parent()
{
return Ice.LocalException;
return Ice.TimeoutException;
}

static get _id()
{
return "::Ice::TimeoutException";
return "::Ice::ConnectionIdleException";
}
};

/**
* This exception indicates a connection establishment timeout condition.
* This exception indicates a timeout condition.
**/
Ice.ConnectTimeoutException = class extends Ice.TimeoutException
Ice.TimeoutException = class extends Ice.LocalException
{
constructor(_cause = "")
{
Expand All @@ -835,19 +835,19 @@ Ice.ConnectTimeoutException = class extends Ice.TimeoutException

static get _parent()
{
return Ice.TimeoutException;
return Ice.LocalException;
}

static get _id()
{
return "::Ice::ConnectTimeoutException";
return "::Ice::TimeoutException";
}
};

/**
* This exception indicates a connection closure timeout condition.
* This exception indicates a connection establishment timeout condition.
**/
Ice.CloseTimeoutException = class extends Ice.TimeoutException
Ice.ConnectTimeoutException = class extends Ice.TimeoutException
{
constructor(_cause = "")
{
Expand All @@ -861,14 +861,14 @@ Ice.CloseTimeoutException = class extends Ice.TimeoutException

static get _id()
{
return "::Ice::CloseTimeoutException";
return "::Ice::ConnectTimeoutException";
}
};

/**
* This exception indicates that a connection has been shut down because it has been idle for some time.
* This exception indicates a connection closure timeout condition.
**/
Ice.ConnectionTimeoutException = class extends Ice.TimeoutException
Ice.CloseTimeoutException = class extends Ice.TimeoutException
{
constructor(_cause = "")
{
Expand All @@ -882,7 +882,7 @@ Ice.ConnectionTimeoutException = class extends Ice.TimeoutException

static get _id()
{
return "::Ice::ConnectionTimeoutException";
return "::Ice::CloseTimeoutException";
}
};

Expand Down
22 changes: 22 additions & 0 deletions matlab/lib/+Ice/ConnectionIdleException.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
% ConnectionIdleException Summary of ConnectionIdleException
%
% This exception indicates that a connection was aborted by the idle check.

% Copyright (c) ZeroC, Inc. All rights reserved.

classdef ConnectionIdleException < Ice.LOcalException
methods
function obj = ConnectionIdleException(ice_exid, ice_exmsg)
if nargin == 0 || isempty(ice_exid)
ice_exid = 'Ice:ConnectionIdleException';
end
if nargin < 2 || isempty(ice_exmsg)
ice_exmsg = 'Ice.ConnectionIdleException';
end
obj = [email protected](ice_exid, ice_exmsg);
end
function id = ice_id(~)
id = '::Ice::ConnectionIdleException';
end
end
end
23 changes: 0 additions & 23 deletions matlab/lib/+Ice/ConnectionTimeoutException.m

This file was deleted.

Loading

0 comments on commit dbba5d6

Please sign in to comment.