Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/app.config
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/app.config	(revision 5794)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/app.config	(revision 5795)
@@ -8,4 +8,7 @@
       </service>
     </services>
+    <client>
+      <endpoint name="SlaveCommunicationServiceEndpoint" address="net.pipe://localhost/HeuristicLabSlaveCom" binding="netNamedPipeBinding" contract="HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts.ISlaveCommunication"/>
+    </client>
 
   </system.serviceModel>
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveCommListener.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveCommListener.cs	(revision 5794)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveCommListener.cs	(revision 5795)
@@ -22,4 +22,5 @@
 using System;
 using System.ServiceModel;
+using System.Threading;
 using HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts;
 
@@ -36,6 +37,20 @@
     public void Open() {
       pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(this, "SlaveCommunicationServiceEndpoint");
-      pipeProxy = pipeFactory.CreateChannel();
-      pipeProxy.Subscribe();
+
+      while (!ReconnectToSlaveCore()) {
+        Thread.Sleep(500);
+      }
+    }
+
+    public bool ReconnectToSlaveCore() {
+      try {
+        pipeProxy = pipeFactory.CreateChannel();
+        pipeProxy.Subscribe();
+        return true;
+      }
+      catch (Exception e) {
+        OnMessageLogged("Couldn't connect to Slave core. Is it possible that the Slave Core isn't running?\nException is: " + e.ToString());
+        return false;
+      }
     }
 
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs	(revision 5794)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs	(revision 5795)
@@ -31,6 +31,6 @@
   [Item("SlaveItem", "Represents a slave which receives messages from the core")]
   public class SlaveItem : Item, ISlaveCommunicationCallbacks, IDisposable {
-    ISlaveCommunication pipeProxy;
-    DuplexChannelFactory<ISlaveCommunication> pipeFactory;
+    private ISlaveCommunication pipeProxy;
+    private DuplexChannelFactory<ISlaveCommunication> pipeFactory;
 
     public SlaveItem() {
@@ -62,32 +62,23 @@
 
     public void Open() {
-      //TODO: read info from app.config
-      pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(this,
-        new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/HeuristicLabSlaveCom"));
+      pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(this, "SlaveCommunicationServiceEndpoint");
+      RegisterEvents();
+    }
 
-      pipeProxy = pipeFactory.CreateChannel();
-      RegisterEvents();
-
+    public bool ReconnectToSlaveCore() {
       try {
+        pipeProxy = pipeFactory.CreateChannel();
         pipeProxy.Subscribe();
+        return true;
       }
       catch (Exception e) {
         OnMessageLogged("Couldn't connect to Slave core. Is it possible that the Slave Core isn't running?\nException is: " + e.ToString());
+        return false;
       }
     }
 
-    public void ReconnectToSlaveCore() {
-      try {
-        pipeProxy = pipeFactory.CreateChannel();
-        pipeProxy.Subscribe();
-      }
-      catch (Exception e) {
-        OnMessageLogged("Couldn't connect to Slave core. Is it possible that the Slave Core isn't running?\nException is: " + e.ToString());
-      }
-    }
-
-    public bool isClosed() {
+    public bool IsClosed() {
       if (pipeFactory == null) return true;
-      return pipeFactory.State == CommunicationState.Closed;
+      return pipeFactory.State == CommunicationState.Closed || pipeFactory.State == CommunicationState.Faulted;
     }
 
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.cs	(revision 5794)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.cs	(revision 5795)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Threading;
+using System.Threading.Tasks;
 using System.Windows.Forms;
 using System.Windows.Forms.DataVisualization.Charting;
@@ -70,8 +73,21 @@
       } else {
         //try to establish a connection to the slave service 
-        if (base.Content != null && ((SlaveItem)base.Content).isClosed()) {
+        if (base.Content != null) {
           ((SlaveItem)base.Content).Open();
+          Task.Factory.StartNew(Connector);
         }
       }
+    }
+
+    private void Connector() {
+      bool connected = false;
+      while (!connected) {
+        this.Invoke(new Func<bool>(() => connected = ((SlaveItem)base.Content).ReconnectToSlaveCore()));
+
+        if (!connected) {
+          Thread.Sleep(1000);
+        }
+      }
+      this.Invoke(new Action(SetEnabledStateOfControls));
     }
 
@@ -89,4 +105,5 @@
     void Content_SlaveShutdown(object sender, System.EventArgs e) {
       txtLog.AppendText("Slave did shutdown\n");
+      Task.Factory.StartNew(Connector);
     }
 
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs	(revision 5794)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs	(revision 5795)
@@ -88,5 +88,6 @@
     public void Pause() {
       if (Job == null) {
-        throw new InvalidStateException("Job is null");
+        SlaveClientCom.Instance.ClientCom.LogMessage("Pausing job: Job is null");
+        Core.EnqueueExecutorMessage(Core.KillAppDomain, JobId);
       }
 
@@ -105,5 +106,6 @@
     public void Stop() {
       if (Job == null) {
-        throw new InvalidStateException("Job is null");
+        SlaveClientCom.Instance.ClientCom.LogMessage("Stopping job: Job is null");
+        Core.EnqueueExecutorMessage(Core.KillAppDomain, JobId);
       }
       wasJobAborted = true;
@@ -193,5 +195,6 @@
     public JobData GetFinishedJob() {
       if (Job == null) {
-        throw new InvalidStateException("Job is null");
+        SlaveClientCom.Instance.ClientCom.LogMessage("Getting finished job: Job is null");
+        Core.EnqueueExecutorMessage(Core.KillAppDomain, JobId);
       }
 
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/SlaveClientCom.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/SlaveClientCom.cs	(revision 5794)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/SlaveClientCom.cs	(revision 5795)
@@ -31,4 +31,6 @@
     private static SlaveClientCom instance;
     private static DuplexChannelFactory<ISlaveCommunication> pipeFactory;
+    public ISlaveCommunication ClientCom { get; set; }
+
     /// <summary>
     /// Getter for the Instance of the SlaveClientCom
@@ -44,6 +46,4 @@
     }
 
-    public ISlaveCommunication ClientCom { get; set; }
-
     private SlaveClientCom() {
       SetupClientCom();
@@ -53,4 +53,5 @@
       DummyListener dummy = new DummyListener();
       pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(dummy, "SlaveCommunicationServiceEndpoint");
+
       ISlaveCommunication pipeProxy = pipeFactory.CreateChannel();
       ClientCom = pipeProxy;
