diff --git a/cpp/include/Ice/LocalException.h b/cpp/include/Ice/LocalException.h index 8a1b1e64645..563cc10fae0 100644 --- a/cpp/include/Ice/LocalException.h +++ b/cpp/include/Ice/LocalException.h @@ -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; @@ -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. @@ -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; @@ -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; diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index c9eebd1ac6f..93a85d17bae 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -901,7 +901,7 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, exc { rethrow_exception(ex); } - catch (const Ice::ConnectionTimeoutException&) + catch (const ConnectionIdleException&) { setState(StateClosed, ex); } @@ -939,7 +939,7 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, exc { rethrow_exception(ex); } - catch (const Ice::ConnectionTimeoutException&) + catch (const ConnectionIdleException&) { setState(StateClosed, ex); } @@ -964,7 +964,7 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, exc { rethrow_exception(ex); } - catch (const Ice::ConnectionTimeoutException&) + catch (const ConnectionIdleException&) { setState(StateClosed, ex); } @@ -1659,7 +1659,7 @@ Ice::ConnectionI::finish(bool close) catch (const ConnectionManuallyClosedException&) { } - catch (const ConnectionTimeoutException&) + catch (const ConnectionIdleException&) { } catch (const CommunicatorDestroyedException&) @@ -2000,7 +2000,7 @@ Ice::ConnectionI::setState(State state, exception_ptr ex) catch (const ConnectionManuallyClosedException&) { } - catch (const ConnectionTimeoutException&) + catch (const ConnectionIdleException&) { } catch (const CommunicatorDestroyedException&) @@ -2178,7 +2178,7 @@ Ice::ConnectionI::setState(State state) catch (const ConnectionManuallyClosedException&) { } - catch (const ConnectionTimeoutException&) + catch (const ConnectionIdleException&) { } catch (const CommunicatorDestroyedException&) @@ -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 diff --git a/cpp/src/Ice/LocalException.cpp b/cpp/src/Ice/LocalException.cpp index 86510d1b53d..2b2627188d1 100644 --- a/cpp/src/Ice/LocalException.cpp +++ b/cpp/src/Ice/LocalException.cpp @@ -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; } @@ -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 { @@ -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 { diff --git a/cpp/test/Ice/idleTimeout/AllTests.cpp b/cpp/test/Ice/idleTimeout/AllTests.cpp index 5a4298eb8d6..3ee798d8b18 100644 --- a/cpp/test/Ice/idleTimeout/AllTests.cpp +++ b/cpp/test/Ice/idleTimeout/AllTests.cpp @@ -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); } diff --git a/js/src/Ice/LocalException.js b/js/src/Ice/LocalException.js index 2f6a20fdd5c..8d9e87ff3c9 100644 --- a/js/src/Ice/LocalException.js +++ b/js/src/Ice/LocalException.js @@ -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 = "") { @@ -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 = "") { @@ -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 = "") { @@ -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 = "") { @@ -882,7 +882,7 @@ Ice.ConnectionTimeoutException = class extends Ice.TimeoutException static get _id() { - return "::Ice::ConnectionTimeoutException"; + return "::Ice::CloseTimeoutException"; } }; diff --git a/matlab/lib/+Ice/ConnectionIdleException.m b/matlab/lib/+Ice/ConnectionIdleException.m new file mode 100644 index 00000000000..f5f8b23b4f4 --- /dev/null +++ b/matlab/lib/+Ice/ConnectionIdleException.m @@ -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 = obj@Ice.LocalException(ice_exid, ice_exmsg); + end + function id = ice_id(~) + id = '::Ice::ConnectionIdleException'; + end + end +end diff --git a/matlab/lib/+Ice/ConnectionTimeoutException.m b/matlab/lib/+Ice/ConnectionTimeoutException.m deleted file mode 100644 index 3d2dc55d684..00000000000 --- a/matlab/lib/+Ice/ConnectionTimeoutException.m +++ /dev/null @@ -1,23 +0,0 @@ -% ConnectionTimeoutException Summary of ConnectionTimeoutException -% -% This exception indicates that a connection has been shut down because it has been idle for some time. - -% Copyright (c) ZeroC, Inc. All rights reserved. -% Generated from LocalException.ice by slice2matlab version 3.7.10 - -classdef ConnectionTimeoutException < Ice.TimeoutException - methods - function obj = ConnectionTimeoutException(ice_exid, ice_exmsg) - if nargin == 0 || isempty(ice_exid) - ice_exid = 'Ice:ConnectionTimeoutException'; - end - if nargin < 2 || isempty(ice_exmsg) - ice_exmsg = 'Ice.ConnectionTimeoutException'; - end - obj = obj@Ice.TimeoutException(ice_exid, ice_exmsg); - end - function id = ice_id(~) - id = '::Ice::ConnectionTimeoutException'; - end - end -end diff --git a/php/lib/IceLocal/LocalException.php b/php/lib/IceLocal/LocalException.php index c2ab4c3f926..1085f745ef4 100644 --- a/php/lib/IceLocal/LocalException.php +++ b/php/lib/IceLocal/LocalException.php @@ -967,57 +967,57 @@ public function __toString(): string namespace Ice { - global $Ice__t_TimeoutException; - class TimeoutException extends \Ice\LocalException + global $Ice__t_ConnectionIdleException; + class ConnectionIdleException extends \Ice\LocalException { public function __construct() { + parent::__construct(); } public function ice_id() { - return '::Ice::TimeoutException'; + return '::Ice::ConnectionIdleException'; } public function __toString(): string { - global $Ice__t_TimeoutException; - return IcePHP_stringifyException($this, $Ice__t_TimeoutException); + global $Ice__t_ConnectionIdleException; + return IcePHP_stringifyException($this, $Ice__t_ConnectionIdleException); } } - $Ice__t_TimeoutException = IcePHP_defineException('::Ice::TimeoutException', '\\Ice\\TimeoutException', null, null); + $Ice__t_ConnectionIdleException = IcePHP_defineException('::Ice::ConnectionIdleException', '\\Ice\\ConnectionIdleException', null, null); } namespace Ice { - global $Ice__t_ConnectTimeoutException; - class ConnectTimeoutException extends \Ice\TimeoutException + global $Ice__t_TimeoutException; + class TimeoutException extends \Ice\LocalException { public function __construct() { - parent::__construct(); } public function ice_id() { - return '::Ice::ConnectTimeoutException'; + return '::Ice::TimeoutException'; } public function __toString(): string { - global $Ice__t_ConnectTimeoutException; - return IcePHP_stringifyException($this, $Ice__t_ConnectTimeoutException); + global $Ice__t_TimeoutException; + return IcePHP_stringifyException($this, $Ice__t_TimeoutException); } } - $Ice__t_ConnectTimeoutException = IcePHP_defineException('::Ice::ConnectTimeoutException', '\\Ice\\ConnectTimeoutException', $Ice__t_TimeoutException, null); + $Ice__t_TimeoutException = IcePHP_defineException('::Ice::TimeoutException', '\\Ice\\TimeoutException', null, null); } namespace Ice { - global $Ice__t_CloseTimeoutException; - class CloseTimeoutException extends \Ice\TimeoutException + global $Ice__t_ConnectTimeoutException; + class ConnectTimeoutException extends \Ice\TimeoutException { public function __construct() { @@ -1026,23 +1026,23 @@ public function __construct() public function ice_id() { - return '::Ice::CloseTimeoutException'; + return '::Ice::ConnectTimeoutException'; } public function __toString(): string { - global $Ice__t_CloseTimeoutException; - return IcePHP_stringifyException($this, $Ice__t_CloseTimeoutException); + global $Ice__t_ConnectTimeoutException; + return IcePHP_stringifyException($this, $Ice__t_ConnectTimeoutException); } } - $Ice__t_CloseTimeoutException = IcePHP_defineException('::Ice::CloseTimeoutException', '\\Ice\\CloseTimeoutException', $Ice__t_TimeoutException, null); + $Ice__t_ConnectTimeoutException = IcePHP_defineException('::Ice::ConnectTimeoutException', '\\Ice\\ConnectTimeoutException', $Ice__t_TimeoutException, null); } namespace Ice { - global $Ice__t_ConnectionTimeoutException; - class ConnectionTimeoutException extends \Ice\TimeoutException + global $Ice__t_CloseTimeoutException; + class CloseTimeoutException extends \Ice\TimeoutException { public function __construct() { @@ -1051,17 +1051,17 @@ public function __construct() public function ice_id() { - return '::Ice::ConnectionTimeoutException'; + return '::Ice::CloseTimeoutException'; } public function __toString(): string { - global $Ice__t_ConnectionTimeoutException; - return IcePHP_stringifyException($this, $Ice__t_ConnectionTimeoutException); + global $Ice__t_CloseTimeoutException; + return IcePHP_stringifyException($this, $Ice__t_CloseTimeoutException); } } - $Ice__t_ConnectionTimeoutException = IcePHP_defineException('::Ice::ConnectionTimeoutException', '\\Ice\\ConnectionTimeoutException', $Ice__t_TimeoutException, null); + $Ice__t_CloseTimeoutException = IcePHP_defineException('::Ice::CloseTimeoutException', '\\Ice\\CloseTimeoutException', $Ice__t_TimeoutException, null); } namespace Ice diff --git a/python/python/Ice/LocalException_local.py b/python/python/Ice/LocalException_local.py index 4389c091711..20dd9577eb5 100644 --- a/python/python/Ice/LocalException_local.py +++ b/python/python/Ice/LocalException_local.py @@ -1147,6 +1147,37 @@ def __str__(self): _M_Ice.OperationInterruptedException = OperationInterruptedException del OperationInterruptedException + +if "ConnectionIdleException" not in _M_Ice.__dict__: + _M_Ice.ConnectionIdleException = Ice.createTempClass() + + class ConnectionIdleException(Ice.LocalException): + """ + This exception indicates that a connection was aborted by the idle check. + """ + + def __init__(self): + pass + + def __str__(self): + return IcePy.stringifyException(self) + + __repr__ = __str__ + + _ice_id = "::Ice::ConnectionIdleException" + + _M_Ice._t_ConnectionIdleException = IcePy.defineException( + "::Ice::ConnectionIdleException", + ConnectionIdleException, + (), + None, + (), + ) + ConnectionIdleException._ice_type = _M_Ice._t_ConnectionIdleException + + _M_Ice.ConnectionIdleException = ConnectionIdleException + del ConnectionIdleException + if "TimeoutException" not in _M_Ice.__dict__: _M_Ice.TimeoutException = Ice.createTempClass() @@ -1233,36 +1264,6 @@ def __str__(self): _M_Ice.CloseTimeoutException = CloseTimeoutException del CloseTimeoutException -if "ConnectionTimeoutException" not in _M_Ice.__dict__: - _M_Ice.ConnectionTimeoutException = Ice.createTempClass() - - class ConnectionTimeoutException(_M_Ice.TimeoutException): - """ - This exception indicates that a connection has been shut down because it has been idle for some time. - """ - - def __init__(self): - _M_Ice.TimeoutException.__init__(self) - - def __str__(self): - return IcePy.stringifyException(self) - - __repr__ = __str__ - - _ice_id = "::Ice::ConnectionTimeoutException" - - _M_Ice._t_ConnectionTimeoutException = IcePy.defineException( - "::Ice::ConnectionTimeoutException", - ConnectionTimeoutException, - (), - _M_Ice._t_TimeoutException, - (), - ) - ConnectionTimeoutException._ice_type = _M_Ice._t_ConnectionTimeoutException - - _M_Ice.ConnectionTimeoutException = ConnectionTimeoutException - del ConnectionTimeoutException - if "InvocationTimeoutException" not in _M_Ice.__dict__: _M_Ice.InvocationTimeoutException = Ice.createTempClass() diff --git a/ruby/ruby/IceLocal/LocalException.rb b/ruby/ruby/IceLocal/LocalException.rb index 68894888ed7..c35b7e3de81 100644 --- a/ruby/ruby/IceLocal/LocalException.rb +++ b/ruby/ruby/IceLocal/LocalException.rb @@ -552,6 +552,19 @@ def to_s T_OperationInterruptedException = ::Ice::__defineException('::Ice::OperationInterruptedException', OperationInterruptedException, nil, []) end + if not defined?(::Ice::ConnectionIdleException) + class ConnectionIdleException < ::Ice::LocalException + def initialize + end + + def to_s + '::Ice::ConnectionIdleException' + end + end + + T_ConnectionIdleException = ::Ice::__defineException('::Ice::ConnectionIdleException', ConnectionIdleException, nil, []) + end + if not defined?(::Ice::TimeoutException) class TimeoutException < Ice::LocalException def initialize @@ -591,19 +604,6 @@ def to_s T_CloseTimeoutException = ::Ice::__defineException('::Ice::CloseTimeoutException', CloseTimeoutException, ::Ice::T_TimeoutException, []) end - if not defined?(::Ice::ConnectionTimeoutException) - class ConnectionTimeoutException < ::Ice::TimeoutException - def initialize - end - - def to_s - '::Ice::ConnectionTimeoutException' - end - end - - T_ConnectionTimeoutException = ::Ice::__defineException('::Ice::ConnectionTimeoutException', ConnectionTimeoutException, ::Ice::T_TimeoutException, []) - end - if not defined?(::Ice::InvocationTimeoutException) class InvocationTimeoutException < ::Ice::TimeoutException def initialize diff --git a/swift/src/Ice/LocalException.swift b/swift/src/Ice/LocalException.swift index 4c1b7372995..4ca88d63e32 100644 --- a/swift/src/Ice/LocalException.swift +++ b/swift/src/Ice/LocalException.swift @@ -899,71 +899,71 @@ open class OperationInterruptedException: LocalException { } } -/// This exception indicates a timeout condition. -open class TimeoutException: LocalException { +/// This exception indicates that a connection was aborted by the idle check. +open class ConnectionIdleException: TimeoutException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. override open class func ice_staticId() -> Swift.String { - return "::Ice::TimeoutException" + return "::Ice::ConnectionIdleException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. override open func ice_print() -> Swift.String { - return _TimeoutExceptionDescription + return _ConnectionIdleExceptionDescription } } -/// This exception indicates a connection establishment timeout condition. -open class ConnectTimeoutException: TimeoutException { +/// This exception indicates a timeout condition. +open class TimeoutException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. override open class func ice_staticId() -> Swift.String { - return "::Ice::ConnectTimeoutException" + return "::Ice::TimeoutException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. override open func ice_print() -> Swift.String { - return _ConnectTimeoutExceptionDescription + return _TimeoutExceptionDescription } } -/// This exception indicates a connection closure timeout condition. -open class CloseTimeoutException: TimeoutException { +/// This exception indicates a connection establishment timeout condition. +open class ConnectTimeoutException: TimeoutException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. override open class func ice_staticId() -> Swift.String { - return "::Ice::CloseTimeoutException" + return "::Ice::ConnectTimeoutException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. override open func ice_print() -> Swift.String { - return _CloseTimeoutExceptionDescription + return _ConnectTimeoutExceptionDescription } } -/// This exception indicates that a connection has been shut down because it has been idle for some time. -open class ConnectionTimeoutException: TimeoutException { +/// This exception indicates a connection closure timeout condition. +open class CloseTimeoutException: TimeoutException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. override open class func ice_staticId() -> Swift.String { - return "::Ice::ConnectionTimeoutException" + return "::Ice::CloseTimeoutException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. override open func ice_print() -> Swift.String { - return _ConnectionTimeoutExceptionDescription + return _CloseTimeoutExceptionDescription } } diff --git a/swift/src/Ice/LocalExceptionDescription.swift b/swift/src/Ice/LocalExceptionDescription.swift index a58abe02ce1..a59636176d7 100644 --- a/swift/src/Ice/LocalExceptionDescription.swift +++ b/swift/src/Ice/LocalExceptionDescription.swift @@ -434,11 +434,11 @@ extension CloseTimeoutException { } } -extension ConnectionTimeoutException { - var _ConnectionTimeoutExceptionDescription: String { +extension ConnectionIdleException { + var _ConnectionIdleExceptionDescription: String { var s = String() - s.sep("connection has timed out") + s.sep("connection aborted by idle check") return s } diff --git a/swift/src/Ice/LocalExceptionFactory.swift b/swift/src/Ice/LocalExceptionFactory.swift index 95de5511692..a2c4aadf34c 100644 --- a/swift/src/Ice/LocalExceptionFactory.swift +++ b/swift/src/Ice/LocalExceptionFactory.swift @@ -189,6 +189,10 @@ class ExceptionFactory: ICEExceptionFactory { return SyscallException(error: error, file: file, line: line) } + static func connectionIdleException(_ file: String, line: Int) -> Error { + return ConnectionIdleException(file: file, line: line) + } + static func connectTimeoutException(_ file: String, line: Int) -> Error { return ConnectTimeoutException(file: file, line: line) } @@ -197,10 +201,6 @@ class ExceptionFactory: ICEExceptionFactory { return CloseTimeoutException(file: file, line: line) } - static func connectionTimeoutException(_ file: String, line: Int) -> Error { - return ConnectionTimeoutException(file: file, line: line) - } - static func invocationTimeoutException(_ file: String, line: Int) -> Error { return InvocationTimeoutException(file: file, line: line) } diff --git a/swift/src/IceImpl/Convert.mm b/swift/src/IceImpl/Convert.mm index 42e6c79f7dd..25a0ccdb2e3 100644 --- a/swift/src/IceImpl/Convert.mm +++ b/swift/src/IceImpl/Convert.mm @@ -207,9 +207,9 @@ { return [factory closeTimeoutException:toNSString(e.ice_file()) line:e.ice_line()]; } - catch (const Ice::ConnectionTimeoutException& e) + catch (const Ice::ConnectionIdleException& e) { - return [factory connectionTimeoutException:toNSString(e.ice_file()) line:e.ice_line()]; + return [factory connectionIdleException:toNSString(e.ice_file()) line:e.ice_line()]; } catch (const Ice::InvocationTimeoutException& e) { diff --git a/swift/src/IceImpl/Exception.h b/swift/src/IceImpl/Exception.h index 71ce9524a13..a853611e1a3 100644 --- a/swift/src/IceImpl/Exception.h +++ b/swift/src/IceImpl/Exception.h @@ -77,10 +77,12 @@ ICEIMPL_API @protocol ICEExceptionFactory + (NSError*)socketException:(int32_t)error file:(NSString*)file line:(size_t)line; + (NSError*)syscallException:(int32_t)error file:(NSString*)file line:(size_t)line; +// ConnectionIdleException ++ (NSError*)connectionIdleException:(NSString*)file line:(size_t)line; + // TimeoutException + (NSError*)connectTimeoutException:(NSString*)file line:(size_t)line; + (NSError*)closeTimeoutException:(NSString*)file line:(size_t)line; -+ (NSError*)connectionTimeoutException:(NSString*)file line:(size_t)line; + (NSError*)invocationTimeoutException:(NSString*)file line:(size_t)line; + (NSError*)timeoutException:(NSString*)file line:(size_t)line;