add disconnect handling
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 11 Apr 2008 06:58:37 +0000 (06:58 +0000)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 11 Apr 2008 06:58:37 +0000 (06:58 +0000)
git-svn-id: http://trooper/svn/projects/jSite/trunk@709 c3eda9e8-030b-0410-8277-bc7414b0a119

src/net/pterodactylus/util/fcp/FcpConnection.java
src/net/pterodactylus/util/fcp/FcpConnectionHandler.java

index d5f05ee..d8c9698 100644 (file)
@@ -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
        //
index 67dd65e..8594c79 100644 (file)
@@ -100,6 +100,7 @@ public class FcpConnectionHandler implements Runnable {
                                break;
                        }
                }
+               fcpConnection.handleDisconnect();
        }
 
        /**