Index: branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/HeuristicLab.Hive.Slave.Communication-3.3.csproj
===================================================================
--- branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/HeuristicLab.Hive.Slave.Communication-3.3.csproj	(revision 4342)
+++ branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/HeuristicLab.Hive.Slave.Communication-3.3.csproj	(revision 4343)
@@ -122,5 +122,5 @@
       <DependentUpon>Settings.settings</DependentUpon>
     </Compile>
-    <Compile Include="SlaveServicePool.cs" />
+    <Compile Include="SlaveServiceCache.cs" />
     <Compile Include="WcfService.cs" />
   </ItemGroup>
Index: branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/SlaveServiceCache.cs
===================================================================
--- branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/SlaveServiceCache.cs	(revision 4343)
+++ branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/SlaveServiceCache.cs	(revision 4343)
@@ -0,0 +1,121 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Hive.Slave.Communication.SlaveService;
+using HeuristicLab.Hive.Contracts;
+using System.ServiceModel;
+using HeuristicLab.Hive.Slave.Communication.Properties;
+using HeuristicLab.Tracing;
+using System.ServiceModel.Security;
+
+namespace HeuristicLab.Hive.Slave.Communication {
+  internal class SlaveServiceCache {
+    /// <summary>
+    /// Cache of SlaveFacadeClients, to check if all get disposed
+    /// </summary>
+    private DisposableSlaveFacadeClient cachedSlaveFacadeClientStreamed = null;
+    private DisposableSlaveFacadeClient cachedSlaveFacadeClient = null;
+    private int streamedClientCount = 0;
+    private int clientCount = 0;
+    private string serverIp;
+    private static object locker = new object();
+
+    public SlaveServiceCache(string serverIp) {
+      this.serverIp = serverIp;
+    }
+
+    internal DisposableSlaveFacadeClient GetSlaveFacade() {
+      lock (locker) {
+        try {
+          if (cachedSlaveFacadeClient == null) {
+            cachedSlaveFacadeClient = new DisposableSlaveFacadeClient("SlaveHttpEndpoint");
+            cachedSlaveFacadeClient.OnDisposing += new EventHandler(OnSlaveClientDisposing);
+            WcfSettings.SetEndpointAddress(cachedSlaveFacadeClient.Endpoint, this.serverIp);
+            SetCredentials(cachedSlaveFacadeClient);
+            cachedSlaveFacadeClient.Open();
+            Logger.Debug("Created SlaveFacadeClient");
+          }
+          clientCount++;
+          Logger.Debug("SlaveFacadeClientCount: " + clientCount);
+          return cachedSlaveFacadeClient;
+        }
+        catch (MessageSecurityException exception) {
+          // more info in innerexception, probably credentials are wrong
+          throw exception.InnerException;
+        }
+      }
+    }
+    
+    internal DisposableSlaveFacadeClient GetStreamedSlaveFacade() {
+      lock (locker) {
+        try {
+          if (cachedSlaveFacadeClientStreamed == null) {
+            cachedSlaveFacadeClientStreamed = new DisposableSlaveFacadeClient("SlaveTcpStreamedEndpoint");
+            cachedSlaveFacadeClientStreamed.OnDisposing += new EventHandler(OnSlaveClientDisposing);
+            WcfSettings.SetEndpointAddress(cachedSlaveFacadeClientStreamed.Endpoint, this.serverIp);
+            SetCredentials(cachedSlaveFacadeClientStreamed);
+            cachedSlaveFacadeClientStreamed.Open();
+            Logger.Debug("Created SlaveFacadeClientStreamed");
+          }
+          streamedClientCount++;
+          Logger.Debug("SlaveFacadeClientCount: " + streamedClientCount);
+          return cachedSlaveFacadeClientStreamed;
+        }
+        catch (MessageSecurityException exception) {
+          // more info in innerexception, probably credentials are wrong
+          throw exception.InnerException;
+        }
+      }
+    }
+
+    private void SetCredentials(SlaveFacadeClient client) {
+      Logger.Debug("Setting credentials for user \"" + Settings.Default.HiveUsername + "\"");
+      client.ClientCredentials.UserName.UserName = Settings.Default.HiveUsername;
+      client.ClientCredentials.UserName.Password = Settings.Default.HivePassword;
+    }
+
+    public void ReleaseSlaveClient(DisposableSlaveFacadeClient slaveFacade) {
+      lock (locker) {
+        if (slaveFacade != null) {
+          if (slaveFacade == cachedSlaveFacadeClient) {
+            clientCount--;
+            Logger.Debug("Disposing SlaveFacadeClient. Count: " + clientCount);
+            if (clientCount < 0)
+              throw new Exception("SlaveFacadeClient Count is less than zero. It was released too often.");
+            if (clientCount == 0) {
+              WcfSettings.DisposeWcfClient((ICommunicationObject)slaveFacade);
+              cachedSlaveFacadeClient = null;
+            }
+          } else if (slaveFacade == cachedSlaveFacadeClientStreamed) {
+            streamedClientCount--;
+            Logger.Debug("Disposing SlaveFacadeClientStreamed. Count: " + streamedClientCount);
+            if (streamedClientCount < 0)
+              throw new Exception("SlaveFacadeClientStreamed Count is less than zero. It was released too often.");
+            if (streamedClientCount == 0) {
+              WcfSettings.DisposeWcfClient((ICommunicationObject)slaveFacade);
+              cachedSlaveFacadeClientStreamed = null;
+            }
+          } else {
+            throw new Exception("Cannot dispose slaveFacade. Cannot be found in cache.");
+          }
+        }
+      } // lock
+    }
+
+    private void OnSlaveClientDisposing(object sender, EventArgs e) {
+      ReleaseSlaveClient((DisposableSlaveFacadeClient)sender);
+    }
+  }
+
+  internal class DisposableSlaveFacadeClient : SlaveFacadeClient, IDisposable {
+    public DisposableSlaveFacadeClient(string endpointConfigurationName) : base(endpointConfigurationName) { }
+
+    public void Dispose() {
+      if (OnDisposing != null)
+        OnDisposing(this, new EventArgs());
+    }
+
+    public event EventHandler OnDisposing;
+  }
+}
Index: branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/SlaveServicePool.cs
===================================================================
--- branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/SlaveServicePool.cs	(revision 4342)
+++ 	(revision )
@@ -1,98 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.Hive.Slave.Communication.SlaveService;
-using HeuristicLab.Hive.Contracts;
-using System.ServiceModel;
-using HeuristicLab.Hive.Slave.Communication.Properties;
-using HeuristicLab.Tracing;
-using System.ServiceModel.Security;
-
-namespace HeuristicLab.Hive.Slave.Communication {
-  internal class SlaveFacadeServicePool {
-    /// <summary>
-    /// Cache of SlaveFacadeClients, to check if all get disposed
-    /// </summary>
-    private SlaveFacadeClient cachedSlaveFacadeClientStreamed = null;
-    private SlaveFacadeClient cachedSlaveFacadeClient = null;
-    private int streamedClientCount = 0;
-    private int clientCount = 0;
-    private string serverIp;
-    private static object locker = new object();
-
-    public SlaveFacadeServicePool(string serverIp) {
-      this.serverIp = serverIp;
-    }
-
-    internal ISlaveFacade CreateSlaveFacade() {
-      lock (locker) {
-        if (cachedSlaveFacadeClient == null) {
-          cachedSlaveFacadeClient = new SlaveFacadeClient("SlaveHttpEndpoint");
-          WcfSettings.SetEndpointAddress(cachedSlaveFacadeClient.Endpoint, this.serverIp);
-          SetCredentials(cachedSlaveFacadeClient);
-          cachedSlaveFacadeClient.Open();
-          Logger.Debug("Created SlaveFacadeClient");
-        }
-        clientCount++;
-        Logger.Debug("SlaveFacadeClientCount: " + clientCount);
-        return cachedSlaveFacadeClient;
-      }
-    }
-
-    internal ISlaveFacade CreateStreamedSlaveFacade() {
-      lock (locker) {
-        try {
-          if (cachedSlaveFacadeClientStreamed == null) {
-            cachedSlaveFacadeClientStreamed = new SlaveFacadeClient("SlaveTcpStreamedEndpoint");
-            WcfSettings.SetEndpointAddress(cachedSlaveFacadeClientStreamed.Endpoint, this.serverIp);
-            SetCredentials(cachedSlaveFacadeClientStreamed);
-            cachedSlaveFacadeClientStreamed.Open();
-            Logger.Debug("Created SlaveFacadeClientStreamed");
-          }
-          streamedClientCount++;
-          Logger.Debug("SlaveFacadeClientCount: " + streamedClientCount);
-          return cachedSlaveFacadeClientStreamed;
-        }
-        catch (MessageSecurityException exception) {
-          // more info in innerexception, probably credentials are wrong
-          throw exception.InnerException;
-        }
-      }
-    }
-
-    private void SetCredentials(SlaveFacadeClient client) {
-      Logger.Debug("Setting credentials for user \"" + Settings.Default.HiveUsername + "\"");
-      client.ClientCredentials.UserName.UserName = Settings.Default.HiveUsername;
-      client.ClientCredentials.UserName.Password = Settings.Default.HivePassword;
-    }
-
-    public void DisposeSlaveClient(ISlaveFacade slaveFacade) {
-      lock (locker) {
-        if (slaveFacade != null) {
-          if (slaveFacade == cachedSlaveFacadeClient) {
-            clientCount--;
-            Logger.Debug("Disposing SlaveFacadeClient. Count: " + clientCount);
-            if (clientCount < 0)
-              throw new Exception("SlaveFacadeClient Count is less than zero. It was released too often.");
-            if (clientCount == 0) {
-              WcfSettings.DisposeWcfClient((ICommunicationObject)slaveFacade);
-              cachedSlaveFacadeClient = null;
-            }
-          } else if (slaveFacade == cachedSlaveFacadeClientStreamed) {
-            streamedClientCount--;
-            Logger.Debug("Disposing SlaveFacadeClientStreamed. Count: " + streamedClientCount);
-            if (streamedClientCount < 0)
-              throw new Exception("SlaveFacadeClientStreamed Count is less than zero. It was released too often.");
-            if (streamedClientCount == 0) {
-              WcfSettings.DisposeWcfClient((ICommunicationObject)slaveFacade);
-              cachedSlaveFacadeClientStreamed = null;
-            }
-          } else {
-            throw new Exception("Cannot dispose slaveFacade. Cannot be found in cache.");
-          }
-        }
-      } // lock
-    }
-  }
-}
Index: branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/WcfService.cs
===================================================================
--- branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/WcfService.cs	(revision 4342)
+++ branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/WcfService.cs	(revision 4343)
@@ -78,5 +78,5 @@
     public event EventHandler Connected;
 
-    SlaveFacadeServicePool servicePool;
+    SlaveServiceCache servicePool;
 
     /// <summary>
@@ -92,32 +92,25 @@
     /// </summary>
     public void Connect() {
-      SlaveService.ISlaveFacade client = null;
-      try {
-        Logger.Debug("Starting the Connection Process");
-        if (String.Empty.Equals(ServerIp)) {
-          Logger.Info("No Server IP set!");
-          return;
-        }
-        servicePool = new SlaveFacadeServicePool(ServerIp);
-
-        Logger.Debug("Creating the new connection proxy");
-        client = servicePool.CreateStreamedSlaveFacade();
-        Logger.Debug("Created the new connection proxy");
-
-        ConnState = NetworkEnum.WcfConnState.Connected;
-        ConnectedSince = DateTime.Now;
-
-        if (Connected != null) {
-          Connected(this, new EventArgs());
-        }
-        if (ConnState == NetworkEnum.WcfConnState.Failed) {
-          ConnectionRestored(this, new EventArgs());
-        }
-      }
-      catch (Exception ex) {
-        HandleNetworkError(ex);
-      }
-      finally {
-        servicePool.DisposeSlaveClient(client);
+      servicePool = new SlaveServiceCache(ServerIp);
+      using (DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade()) {
+        try {
+          Logger.Debug("Starting the Connection Process");
+          if (String.Empty.Equals(ServerIp)) {
+            Logger.Info("No Server IP set!");
+            return;
+          }
+          ConnState = NetworkEnum.WcfConnState.Connected;
+          ConnectedSince = DateTime.Now;
+
+          if (Connected != null) {
+            Connected(this, new EventArgs());
+          }
+          if (ConnState == NetworkEnum.WcfConnState.Failed) {
+            ConnectionRestored(this, new EventArgs());
+          }
+        }
+        catch (Exception ex) {
+          HandleNetworkError(ex);
+        }
       }
     }
@@ -145,24 +138,21 @@
     /// </summary>
     public void Login(SlaveDto slaveInfo) {
-      SlaveService.ISlaveFacade client = null;
-      try {
-        if (ConnState == NetworkEnum.WcfConnState.Connected) {
-          Logger.Debug("STARTED: Login Sync");
-          client = servicePool.CreateSlaveFacade();
-          Response res = client.Login(slaveInfo);
-          if (res.StatusMessage != ResponseStatus.Ok) {
-            Logger.Error("FAILED: Login Failed! " + res.StatusMessage);
-            throw new Exception(res.StatusMessage.ToString());
-          } else {
-            Logger.Info("ENDED: Login succeeded" + res.StatusMessage);
-            LoggedIn = true;
-          }
-        }
-      }
-      catch (Exception e) {
-        HandleNetworkError(e);
-      }
-      finally {
-        servicePool.DisposeSlaveClient(client);
+      using (DisposableSlaveFacadeClient client = servicePool.GetSlaveFacade()) {
+        try {
+          if (ConnState == NetworkEnum.WcfConnState.Connected) {
+            Logger.Debug("STARTED: Login Sync");
+            Response res = client.Login(slaveInfo);
+            if (res.StatusMessage != ResponseStatus.Ok) {
+              Logger.Error("FAILED: Login Failed! " + res.StatusMessage);
+              throw new Exception(res.StatusMessage.ToString());
+            } else {
+              Logger.Info("ENDED: Login succeeded" + res.StatusMessage);
+              LoggedIn = true;
+            }
+          }
+        }
+        catch (Exception e) {
+          HandleNetworkError(e);
+        }
       }
     }
@@ -175,7 +165,6 @@
     public void GetJobAsync(Guid guid) {
       if (LoggedIn) {
+        DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade();
         Logger.Debug("STARTED: Fetching of Jobs from Server for Slave");
-        SlaveService.ISlaveFacade client = servicePool.CreateStreamedSlaveFacade();
-        //client.GetStreamedJobAsync(guid);
         client.BeginGetStreamedJob(guid, (ar => {
           if (ar.IsCompleted) {
@@ -213,9 +202,9 @@
               if (memStream != null)
                 memStream.Dispose();
+
+              servicePool.ReleaseSlaveClient(client);
             }
           } else
             HandleNetworkError(new FaultException("GetJobAsync did not complete"));
-
-          servicePool.DisposeSlaveClient(client);
         }), null);
       }
@@ -231,4 +220,5 @@
     public void GetFinishedJobResultAsync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception, bool finished) {
       if (LoggedIn) {
+        DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade();
         Logger.Debug("STARTED: Sending back the finished job results");
         Logger.Debug("Building stream");
@@ -236,21 +226,24 @@
         Logger.Debug("Builded stream");
         Logger.Debug("Making the call");
-        //proxy.StoreFinishedJobResultStreamedAsync(stream, stream);
-        SlaveService.ISlaveFacade client = servicePool.CreateStreamedSlaveFacade();
+
         client.BeginStoreFinishedJobResultStreamed(stream, (ar => {
-          Logger.Debug("Finished storing the job");
-          if (stream != null)
-            stream.Dispose();
-
-          if (ar.IsCompleted) {
-            var res = client.EndStoreFinishedJobResultStreamed(ar);
-            StoreFinishedJobResultCompletedEventArgs args = new StoreFinishedJobResultCompletedEventArgs(new object[] { res }, null, false, null);
-            Logger.Debug("calling the Finished Job Event");
-            GetFinishedJobResultCompleted(this, args);
-            Logger.Debug("ENDED: Sending back the finished job results");
-          } else {
-            HandleNetworkError(new FaultException("GetFinishedJobResultAsync did not complete"));
-          }
-          servicePool.DisposeSlaveClient(client);
+          try {
+            Logger.Debug("Finished storing the job");
+            if (stream != null)
+              stream.Dispose();
+
+            if (ar.IsCompleted) {
+              var res = client.EndStoreFinishedJobResultStreamed(ar);
+              StoreFinishedJobResultCompletedEventArgs args = new StoreFinishedJobResultCompletedEventArgs(new object[] { res }, null, false, null);
+              Logger.Debug("calling the Finished Job Event");
+              GetFinishedJobResultCompleted(this, args);
+              Logger.Debug("ENDED: Sending back the finished job results");
+            } else {
+              HandleNetworkError(new FaultException("GetFinishedJobResultAsync did not complete"));
+            }
+          }
+          finally {
+            servicePool.ReleaseSlaveClient(client);
+          }
         }), null);
       }
@@ -263,50 +256,48 @@
     public void ProcessSnapshotAsync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception, bool finished) {
       if (LoggedIn) {
+        DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade();
+
         Stream stream = GetStreamedJobResult(clientId, jobId, result, percentage, exception);
-        //proxy.ProcessSnapshotStreamedAsync(stream, stream);
-        SlaveService.ISlaveFacade client = servicePool.CreateStreamedSlaveFacade();
         client.BeginProcessSnapshotStreamed(stream, (ar => {
-          if (stream != null)
-            stream.Dispose();
-
-          if (ar.IsCompleted) {
-            var res = client.EndStoreFinishedJobResultStreamed(ar);
-            ProcessSnapshotCompletedEventArgs args = new ProcessSnapshotCompletedEventArgs(new object[] { res }, null, false, null);
-            ProcessSnapshotCompleted(this, args);
+          try {
+            if (stream != null)
+              stream.Dispose();
+
+            if (ar.IsCompleted) {
+              var res = client.EndStoreFinishedJobResultStreamed(ar);
+              ProcessSnapshotCompletedEventArgs args = new ProcessSnapshotCompletedEventArgs(new object[] { res }, null, false, null);
+              ProcessSnapshotCompleted(this, args);
+            } else {
+              HandleNetworkError(new FaultException("ProcessSnapshotAsync did not complete"));
+            }
+          }
+          finally {
+            servicePool.ReleaseSlaveClient(client);
+          }
+        }), null);
+      }
+    }
+
+    #endregion
+
+    /// <summary>
+    /// Methods for sending the periodically Heartbeat
+    /// </summary>
+    #region Heartbeat
+
+    public event System.EventHandler<ProcessHeartBeatCompletedEventArgs> ProcessHeartBeatCompleted;
+    public void ProcessHeartBeatSync(HeartBeatData hbd) {
+      if (LoggedIn) {
+        using (DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade()) {
+          Logger.Debug("STARTING: sending heartbeat");
+          var res = client.ProcessHeartBeat(hbd);
+
+          if (res.StatusMessage == ResponseStatus.Ok) {
+            ProcessHeartBeatCompleted(this, new ProcessHeartBeatCompletedEventArgs(new object[] { res }, null, false, null));
+            Logger.Debug("ENDED: sending heartbeats");
           } else {
-            HandleNetworkError(new FaultException("ProcessSnapshotAsync did not complete"));
-          }
-          servicePool.DisposeSlaveClient(client);
-        }), null);
-      }
-    }
-
-    #endregion
-
-    /// <summary>
-    /// Methods for sending the periodically Heartbeat
-    /// </summary>
-    #region Heartbeat
-
-    public event System.EventHandler<ProcessHeartBeatCompletedEventArgs> ProcessHeartBeatCompleted;
-    public void ProcessHeartBeatAsync(HeartBeatData hbd) {
-      if (LoggedIn) {
-        Logger.Debug("STARTING: sending heartbeat");
-        //proxy.ProcessHeartBeatAsync(hbd);
-        SlaveService.ISlaveFacade client = servicePool.CreateStreamedSlaveFacade();
-        client.BeginProcessHeartBeat(hbd, (ar => {
-          if (ar.IsCompleted) {
-            var res = client.EndProcessHeartBeat(ar);
-            if (res.StatusMessage == ResponseStatus.Ok) {
-              ProcessHeartBeatCompleted(this, new ProcessHeartBeatCompletedEventArgs(new object[] { res }, null, false, null));
-              Logger.Debug("ENDED: sending heartbeats");
-            } else {
-              Logger.Error("FAILED: sending heartbeats: " + res.StatusMessage.ToString());
-            }
-          } else {
-            HandleNetworkError(new FaultException("ProcessHeartBeatAsync did not complete"));
-          }
-          servicePool.DisposeSlaveClient(client);
-        }), null);
+            Logger.Error("FAILED: sending heartbeats: " + res.StatusMessage.ToString());
+          }
+        }
       }
     }
@@ -337,8 +328,8 @@
 
     public ResponseResultReceived StoreFinishedJobResultsSync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception, bool finished) {
-      SlaveService.ISlaveFacade client = servicePool.CreateStreamedSlaveFacade();
-      ResponseResultReceived res = client.StoreFinishedJobResultStreamed(GetStreamedJobResult(clientId, jobId, result, percentage, exception));
-      servicePool.DisposeSlaveClient(client);
-      return res;
+      using (DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade()) {
+        ResponseResultReceived res = client.StoreFinishedJobResultStreamed(GetStreamedJobResult(clientId, jobId, result, percentage, exception));
+        return res;
+      }
     }
 
@@ -346,9 +337,9 @@
       try {
         Logger.Debug("STARTING: Sync call: IsJobStillNeeded");
-        SlaveService.ISlaveFacade client = servicePool.CreateStreamedSlaveFacade();
-        Response res = client.IsJobStillNeeded(jobId);
-        servicePool.DisposeSlaveClient(client);
-        Logger.Debug("ENDED: Sync call: IsJobStillNeeded");
-        return res;
+        using (DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade()) {
+          Response res = client.IsJobStillNeeded(jobId);
+          Logger.Debug("ENDED: Sync call: IsJobStillNeeded");
+          return res;
+        }
       }
       catch (Exception e) {
@@ -360,8 +351,7 @@
     public ResponseResultReceived ProcessSnapshotSync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) {
       try {
-        SlaveService.ISlaveFacade client = servicePool.CreateStreamedSlaveFacade();
-        var res = client.ProcessSnapshotStreamed(GetStreamedJobResult(clientId, jobId, result, percentage, exception));
-        servicePool.DisposeSlaveClient(client);
-        return res;
+        using (DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade()) {
+          return client.ProcessSnapshotStreamed(GetStreamedJobResult(clientId, jobId, result, percentage, exception));
+        }
       }
       catch (Exception e) {
@@ -373,17 +363,17 @@
     public IEnumerable<CachedHivePluginInfoDto> RequestPlugins(List<HivePluginInfoDto> requestedPlugins) {
       try {
-        Logger.Debug("STARTED: Requesting Plugins for Job");
-        Logger.Debug("STARTED: Getting the stream");
-        SlaveService.ISlaveFacade client = servicePool.CreateStreamedSlaveFacade();
-        Stream stream = client.GetStreamedPlugins(requestedPlugins.ToArray());
-        servicePool.DisposeSlaveClient(client);
-        Logger.Debug("ENDED: Getting the stream");
-        BinaryFormatter formatter = new BinaryFormatter();
-        Logger.Debug("STARTED: Deserializing the stream");
-        ResponseList<CachedHivePluginInfoDto> response = (ResponseList<CachedHivePluginInfoDto>)formatter.Deserialize(stream);
-        Logger.Debug("ENDED: Deserializing the stream");
-        if (stream != null)
-          stream.Dispose();
-        return response.List;
+        using (DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade()) {
+          Logger.Debug("STARTED: Requesting Plugins for Job");
+          Logger.Debug("STARTED: Getting the stream");
+          Stream stream = client.GetStreamedPlugins(requestedPlugins.ToArray());
+          Logger.Debug("ENDED: Getting the stream");
+          BinaryFormatter formatter = new BinaryFormatter();
+          Logger.Debug("STARTED: Deserializing the stream");
+          ResponseList<CachedHivePluginInfoDto> response = (ResponseList<CachedHivePluginInfoDto>)formatter.Deserialize(stream);
+          Logger.Debug("ENDED: Deserializing the stream");
+          if (stream != null)
+            stream.Dispose();
+          return response.List;
+        }
       }
       catch (Exception e) {
@@ -396,7 +386,7 @@
       try {
         Logger.Debug("STARTED: Logout");
-        SlaveService.ISlaveFacade client = servicePool.CreateStreamedSlaveFacade();
-        client.Logout(guid);
-        servicePool.DisposeSlaveClient(client);
+        using (DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade()) {
+          client.Logout(guid);
+        }
         Logger.Debug("ENDED: Logout");
       }
@@ -409,9 +399,9 @@
       try {
         Logger.Debug("STARTED: Syncing Calendars");
-        SlaveService.ISlaveFacade client = servicePool.CreateStreamedSlaveFacade();
-        ResponseCalendar cal = client.GetCalendar(clientId);
-        servicePool.DisposeSlaveClient(client);
-        Logger.Debug("ENDED: Syncing Calendars");
-        return cal;
+        using (DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade()) {
+          ResponseCalendar cal = client.GetCalendar(clientId);
+          Logger.Debug("ENDED: Syncing Calendars");
+          return cal;
+        }
       }
       catch (Exception e) {
@@ -424,9 +414,9 @@
       try {
         Logger.Debug("STARTED: Setting Calendar status to: " + state);
-        SlaveService.ISlaveFacade client = servicePool.CreateStreamedSlaveFacade();
-        Response resp = client.SetCalendarStatus(clientId, state);
-        servicePool.DisposeSlaveClient(client);
-        Logger.Debug("ENDED: Setting Calendar status to: " + state);
-        return resp;
+        using (DisposableSlaveFacadeClient client = servicePool.GetStreamedSlaveFacade()) {
+          Response resp = client.SetCalendarStatus(clientId, state);
+          Logger.Debug("ENDED: Setting Calendar status to: " + state);
+          return resp;
+        }
       }
       catch (Exception e) {
