Close invitation connections after use.

This commit is contained in:
akwizgran
2013-03-11 10:31:31 +00:00
parent 4d590f4533
commit a02ca4b356
3 changed files with 5 additions and 0 deletions

View File

@@ -97,5 +97,7 @@ class AliceConnector extends Connector {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
return; return;
} }
// That's all, folks!
tryToClose(conn, false);
} }
} }

View File

@@ -97,5 +97,7 @@ class BobConnector extends Connector {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
return; return;
} }
// That's all, folks!
tryToClose(conn, false);
} }
} }

View File

@@ -90,6 +90,7 @@ abstract class Connector extends Thread {
protected void tryToClose(DuplexTransportConnection conn, protected void tryToClose(DuplexTransportConnection conn,
boolean exception) { boolean exception) {
try { try {
if(LOG.isLoggable(INFO)) LOG.info("Closing connection");
conn.dispose(exception, true); conn.dispose(exception, true);
} catch(IOException e) { } catch(IOException e) {
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);