Index: branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs	(revision 13546)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs	(revision 13547)
@@ -24,5 +24,4 @@
     private ConcurrentQueue<SolutionInfo> writeQueue;
     private ConcurrentQueue<SolutionInfo> readQueue;
-    private bool collectingInFirstQueue = true; //currently first queue is filled with recieved populations
 
     //uses IMessageService for recieving population from one peer at once
@@ -55,4 +54,12 @@
       } catch (Exception ex) {
         AddError("PeerNetworkMessageHandler.Init", ex);
+      }
+    }
+
+    public void Dispose() {
+      try {
+        host.Dispose();
+      } catch (Exception ex) {
+        AddError("PeerNetworkMessageHandler.Dispose", ex);
       }
     }
@@ -144,4 +151,5 @@
       }
     }
+
   }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs	(revision 13546)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs	(revision 13547)
@@ -42,4 +42,8 @@
     }
 
+    public void Dispose() {
+      _ResetEvent.Set();
+    }
+
     private int FreeTcpPort() {
       TcpListener l = new TcpListener(IPAddress.Loopback, 0);
@@ -55,5 +59,4 @@
       }
     }
-
   }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageHandler.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageHandler.cs	(revision 13546)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageHandler.cs	(revision 13547)
@@ -1,22 +1,18 @@
-﻿using DistributedGA.Core.Domain;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+﻿using System.Collections.Generic;
+using DistributedGA.Core.Domain;
 
-namespace DistributedGA.Core.Interface
-{
-    public interface IMessageHandler
-    {
-        void Init(); //Registers at contract-server
+namespace DistributedGA.Core.Interface {
+  public interface IMessageHandler {
+    void Init(); //Registers at contract-server
 
-        void PublishMigrationInfo(SolutionInfo[] population);
+    void PublishMigrationInfo(SolutionInfo[] population);
 
-        SolutionInfo[] GetMigrationInfo();
+    SolutionInfo[] GetMigrationInfo();
 
-        PeerInfo GetPeerInfo();
+    PeerInfo GetPeerInfo();
 
-        List<PeerInfo> GetCurrentNetwork();
-    }
+    List<PeerInfo> GetCurrentNetwork();
+
+    void Dispose();
+  }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageService.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageService.cs	(revision 13546)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageService.cs	(revision 13547)
@@ -1,21 +1,17 @@
-﻿using DistributedGA.Core.Domain;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+﻿using System;
+using DistributedGA.Core.Domain;
 
-namespace DistributedGA.Core.Interface
-{
-    public interface IMessageService
-    {
-        /// <summary>
-        /// Initializes a WCF service and host it with another thread
-        /// </summary>
-        /// <param name="ip">current external ip address</param>
-        /// <returns>The port, on which the service was successfully hosted</returns>
-        int Init(string ip);
+namespace DistributedGA.Core.Interface {
+  public interface IMessageService {
+    /// <summary>
+    /// Initializes a WCF service and host it with another thread
+    /// </summary>
+    /// <param name="ip">current external ip address</param>
+    /// <returns>The port, on which the service was successfully hosted</returns>
+    int Init(string ip);
 
-        event EventHandler<MessageRecieveEventArgs> OnPopulationRecieved;
-    }
+    void Dispose();
+
+    event EventHandler<MessageRecieveEventArgs> OnPopulationRecieved;
+  }
 }
