fire disconnected event only once
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 14 May 2008 07:07:41 +0000 (07:07 +0000)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 14 May 2008 07:07:41 +0000 (07:07 +0000)
git-svn-id: http://trooper/svn/projects/jFCPlib/branch/high-level-client@873 c3eda9e8-030b-0410-8277-bc7414b0a119

src/net/pterodactylus/fcp/highlevel/HighLevelClient.java

index 5de3aa2..b64601d 100644 (file)
@@ -106,7 +106,7 @@ public class HighLevelClient {
        private final String clientName;
 
        /** The FCP connection to the node. */
-       private FcpConnection fcpConnection;
+       private FcpConnection fcpConnection = null;
 
        /** Listeners for high-level client events. */
        private List<HighLevelClientListener> highLevelClientListeners = Collections.synchronizedList(new ArrayList<HighLevelClientListener>());
@@ -518,7 +518,6 @@ public class HighLevelClient {
                        fcpConnection.close();
                }
                fcpConnection = null;
-               fireClientDisconnected(throwable);
        }
 
        /**
@@ -711,6 +710,7 @@ public class HighLevelClient {
                        }
                        cancelIdentifier(null);
                        disconnect(throwable);
+                       fireClientDisconnected(throwable);
                }
 
                /**