Stop remote server fix
[fanfix.git] / src / be / nikiroo / fanfix / library / RemoteLibrary.java
index 9453d674e1df4c18f8ffd959b7f5ab916bf971e9..06370320fb94a6709f543e859841d4e176e4f8de 100644 (file)
@@ -270,6 +270,27 @@ public class RemoteLibrary extends BasicLibrary {
                                "Operation not supportorted on remote Libraries");
        }
 
+       /**
+        * Stop the server.
+        */
+       public void exit() {
+               try {
+                       new ConnectActionClientObject(host, port, true) {
+                               @Override
+                               public void action(Version serverVersion) throws Exception {
+                                       send(new Object[] { md5, "EXIT" });
+                               }
+
+                               @Override
+                               protected void onError(Exception e) {
+                                       Instance.getTraceHandler().error(e);
+                               }
+                       }.connect();
+               } catch (IOException e) {
+                       Instance.getTraceHandler().error(e);
+               }
+       }
+
        @Override
        protected List<MetaData> getMetas(Progress pg) {
                final Progress pgF = pg;