Handle exceptions thrown by connections' dispose() methods.

This commit is contained in:
akwizgran
2012-09-07 12:46:45 +01:00
parent 0fa945a7ed
commit 2e2eba820d
3 changed files with 27 additions and 7 deletions

View File

@@ -88,7 +88,11 @@ class IncomingSimplexConnection {
transport.dispose(false, true); transport.dispose(false, true);
} catch(IOException e) { } catch(IOException e) {
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString()); if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
try {
transport.dispose(true, true); transport.dispose(true, true);
} catch(IOException e1) {
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
}
} finally { } finally {
connRegistry.unregisterConnection(contactId, transportId); connRegistry.unregisterConnection(contactId, transportId);
} }

View File

@@ -103,10 +103,18 @@ class OutgoingSimplexConnection {
transport.dispose(false); transport.dispose(false);
} catch(DbException e) { } catch(DbException e) {
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString()); if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
try {
transport.dispose(true); transport.dispose(true);
} catch(IOException e1) {
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
}
} catch(IOException e) { } catch(IOException e) {
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString()); if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
try {
transport.dispose(true); transport.dispose(true);
} catch(IOException e1) {
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
}
} finally { } finally {
connRegistry.unregisterConnection(contactId, transportId); connRegistry.unregisterConnection(contactId, transportId);
} }

View File

@@ -96,10 +96,18 @@ class ConnectionDispatcherImpl implements ConnectionDispatcher {
transport); transport);
} catch(DbException e) { } catch(DbException e) {
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString()); if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
try {
transport.dispose(true, false); transport.dispose(true, false);
} catch(IOException e1) {
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
}
} catch(IOException e) { } catch(IOException e) {
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString()); if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
try {
transport.dispose(true, false); transport.dispose(true, false);
} catch(IOException e1) {
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
}
} }
} }
} }