Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs	(revision 5266)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs	(revision 5280)
@@ -24,4 +24,5 @@
 using System.IO;
 using System.Runtime.CompilerServices;
+using System.ServiceModel;
 using System.Threading;
 using HeuristicLab.Clients.Hive.Slave;
@@ -39,4 +40,5 @@
   public class Core : MarshalByRefObject {
     public static bool abortRequested { get; set; }
+    private Semaphore waitShutdownSem = new Semaphore(0, 1);
     public static ILog Log { get; set; }
 
@@ -50,4 +52,5 @@
 
     private ISlaveCommunication ClientCom;
+    private ServiceHost slaveComm;
 
     public Dictionary<Guid, Executor> ExecutionEngines {
@@ -60,12 +63,16 @@
 
     public Core() {
+    }
+
+    /// <summary>
+    /// Main Method for the client
+    /// </summary>
+    public void Start() {
       coreThreadId = Thread.CurrentThread.ManagedThreadId;
-    }
-
-    /// <summary>
-    /// Main Method for the client
-    /// </summary>
-    public void Start() {
       abortRequested = false;
+
+      //start the client communication service (pipe between slave and slave gui)
+      slaveComm = new ServiceHost(typeof(SlaveCommunicationService));
+      slaveComm.Open();
 
       ClientCom = SlaveClientCom.Instance.ClientCom;
@@ -82,4 +89,5 @@
 
       DeRegisterServiceEvents();
+      waitShutdownSem.Release();
     }
 
@@ -110,5 +118,4 @@
     void wcfService_ExceptionOccured(object sender, EventArgs<Exception> e) {
       ClientCom.LogMessage("Connection to server interruped with exception: " + e.Value.Message);
-      ShutdownCore();
     }
 
@@ -159,5 +166,11 @@
     }
 
-    public void ShutdownCore() {
+    public void Shutdown() {
+      MessageContainer mc = new MessageContainer(MessageContainer.MessageType.ShutdownSlave);
+      MessageQueue.GetInstance().AddMessage(mc);
+      waitShutdownSem.WaitOne();
+    }
+
+    private void ShutdownCore() {
       ClientCom.LogMessage("Shutdown Signal received");
       ClientCom.LogMessage("Stopping heartbeat");
@@ -165,4 +178,5 @@
       abortRequested = true;
       ClientCom.LogMessage("Logging out");
+
 
       lock (engines) {
@@ -177,4 +191,7 @@
       ClientCom.Shutdown();
       SlaveClientCom.Close();
+
+      if (slaveComm.State != CommunicationState.Closed)
+        slaveComm.Close();
     }
 
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/app.config
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/app.config	(revision 5266)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/app.config	(revision 5280)
@@ -15,4 +15,16 @@
 
   <system.serviceModel>
+    <bindings>
+      <wsHttpBinding>
+        <binding name="wsHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
+          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
+          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
+          <security mode="Message">
+            <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
+            <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default"/>
+          </security>
+        </binding>
+      </wsHttpBinding>
+    </bindings>
     <services>
       <service name="HeuristicLab.Clients.Hive.Slave.SlaveCommunicationService">        
@@ -20,4 +32,11 @@
       </service>
     </services>
+    <client>
+      <endpoint address="http://localhost:9000/Hive-3.4" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="HeuristicLab.Services.Hive.Common.ServiceContracts.IHiveService" name="wsHttpBinding_IHiveService">
+        <identity>
+          <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac="/>
+        </identity>
+      </endpoint>
+    </client>
   </system.serviceModel>
 
