Allow adding of FCP listeners to underlying FCP connection.
[jFCPlib.git] / src / net / pterodactylus / fcp / highlevel / FcpClient.java
index f2a80a1..cdf438b 100644 (file)
@@ -168,6 +168,7 @@ public class FcpClient {
                        @Override
                        @SuppressWarnings("synthetic-access")
                        public void connectionClosed(FcpConnection fcpConnection, Throwable throwable) {
+                               connected = false;
                                fcpClientListenerManager.fireFcpClientDisconnected();
                        }
                });
@@ -178,6 +179,26 @@ public class FcpClient {
        //
 
        /**
+        * Adds an FCP listener to the underlying connection.
+        *
+        * @param fcpListener
+        *            The FCP listener to add
+        */
+       public void addFcpListener(FcpListener fcpListener) {
+               fcpConnection.addFcpListener(fcpListener);
+       }
+
+       /**
+        * Removes an FCP listener from the underlying connection.
+        *
+        * @param fcpListener
+        *            The FCP listener to remove
+        */
+       public void removeFcpListener(FcpListener fcpListener) {
+               fcpConnection.removeFcpListener(fcpListener);
+       }
+
+       /**
         * Adds an FCP client listener to the list of registered listeners.
         *
         * @param fcpClientListener