diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-04-27 14:33:30 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-04-27 14:33:30 +0200 |
commit | c62cd6c4d50c7f762aefc76bc36bfa1e34022e72 (patch) | |
tree | c1751dc479145b27fe66ccebd56b257b2b3e04f9 /csharp/src | |
parent | Added ClientPrivate.js to .gitignore (diff) | |
download | ice-c62cd6c4d50c7f762aefc76bc36bfa1e34022e72.tar.bz2 ice-c62cd6c4d50c7f762aefc76bc36bfa1e34022e72.tar.xz ice-c62cd6c4d50c7f762aefc76bc36bfa1e34022e72.zip |
Fix to no longer close the socket on fdToString failure, the caller is now closing the socket if necessary
Diffstat (limited to 'csharp/src')
-rw-r--r-- | csharp/src/Ice/StreamSocket.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/csharp/src/Ice/StreamSocket.cs b/csharp/src/Ice/StreamSocket.cs index 6cebaff9662..6801484906d 100644 --- a/csharp/src/Ice/StreamSocket.cs +++ b/csharp/src/Ice/StreamSocket.cs @@ -41,7 +41,15 @@ namespace IceInternal _instance = instance; _fd = fd; _state = StateConnected; - _desc = IceInternal.Network.fdToString(_fd); + try + { + _desc = IceInternal.Network.fdToString(_fd); + } + catch(Exception ex) + { + Network.closeSocketNoThrow(_fd); + throw ex; + } init(); } @@ -394,11 +402,7 @@ namespace IceInternal Debug.Assert(_fd != null); try { - _fd.Close(); - } - catch(SocketException ex) - { - throw new Ice.SocketException(ex); + Network.closeSocket(_fd); } finally { |