import be.nikiroo.fanfix.supported.BasicSupport.SupportType;
import be.nikiroo.utils.Progress;
import be.nikiroo.utils.Version;
-import be.nikiroo.utils.serial.server.ConnectActionClientObject;
import be.nikiroo.utils.serial.server.ServerObject;
/**
break;
}
- try {
- final String fkey = key;
- new ConnectActionClientObject(host, port, true) {
- @Override
- public void action(Version serverVersion)
- throws Exception {
- try {
- send(new Object[] { fkey, "EXIT" });
- } catch (Exception e) {
- Instance.getTraceHandler().error(e);
- }
- }
- }.connect();
- } catch (IOException e) {
- Instance.getTraceHandler().error(e);
- }
+ new RemoteLibrary(key, host, port).exit();
break;
case REMOTE:
exitCode = 255; // should not be reachable (REMOTE -> START)
"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;