diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-06-03 18:17:59 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-06-03 18:17:59 +0200 |
commit | c4035e1fb3fe8d54d826b3f61aeaac4d91019385 (patch) | |
tree | d3e49482e1284dddcdef82f6168a281df43ffd1a /csharp/src | |
parent | Fixed use of deprecated IceSSL property (diff) | |
download | ice-c4035e1fb3fe8d54d826b3f61aeaac4d91019385.tar.bz2 ice-c4035e1fb3fe8d54d826b3f61aeaac4d91019385.tar.xz ice-c4035e1fb3fe8d54d826b3f61aeaac4d91019385.zip |
Fixed initConnectionInfo to no longer throw
Diffstat (limited to 'csharp/src')
-rw-r--r-- | csharp/src/Ice/ConnectionI.cs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/csharp/src/Ice/ConnectionI.cs b/csharp/src/Ice/ConnectionI.cs index 581536eade7..ba6729d48ba 100644 --- a/csharp/src/Ice/ConnectionI.cs +++ b/csharp/src/Ice/ConnectionI.cs @@ -2661,20 +2661,23 @@ namespace Ice private ConnectionInfo initConnectionInfo() { - if(_info != null) + if(_state > StateNotInitialized && _info != null) // Update the connection info until it's initialized { return _info; } - ConnectionInfo info = _transceiver.getInfo(); - info.connectionId = _endpoint.connectionId(); - info.adapterName = _adapter != null ? _adapter.getName() : ""; - info.incoming = _connector == null; - if(_state > StateNotInitialized) + try + { + _info = _transceiver.getInfo(); + } + catch(Ice.LocalException) { - _info = info; // Cache the connection information only if initialized. + _info = new ConnectionInfo(); } - return info; + _info.connectionId = _endpoint.connectionId(); + _info.adapterName = _adapter != null ? _adapter.getName() : ""; + _info.incoming = _connector == null; + return _info; } private void reap() |