From: David ‘Bombe’ Roden Date: Fri, 11 Apr 2008 06:58:37 +0000 (+0000) Subject: add disconnect handling X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=43021dab66b89867961d48e13ad7c8e8e9e50969;p=jSite2.git add disconnect handling git-svn-id: http://trooper/svn/projects/jSite/trunk@709 c3eda9e8-030b-0410-8277-bc7414b0a119 --- diff --git a/src/net/pterodactylus/util/fcp/FcpConnection.java b/src/net/pterodactylus/util/fcp/FcpConnection.java index d5f05ee..d8c9698 100644 --- a/src/net/pterodactylus/util/fcp/FcpConnection.java +++ b/src/net/pterodactylus/util/fcp/FcpConnection.java @@ -534,6 +534,16 @@ public class FcpConnection { } } + /** + * Handles a disconnect from the node. + */ + synchronized void handleDisconnect() { + Closer.close(remoteInputStream); + Closer.close(remoteOutputStream); + Closer.close(remoteSocket); + connectionHandler = null; + } + // // PRIVATE METHODS // diff --git a/src/net/pterodactylus/util/fcp/FcpConnectionHandler.java b/src/net/pterodactylus/util/fcp/FcpConnectionHandler.java index 67dd65e..8594c79 100644 --- a/src/net/pterodactylus/util/fcp/FcpConnectionHandler.java +++ b/src/net/pterodactylus/util/fcp/FcpConnectionHandler.java @@ -100,6 +100,7 @@ public class FcpConnectionHandler implements Runnable { break; } } + fcpConnection.handleDisconnect(); } /**