Index: branches/thasling/DistributedGA/DistributedGA.ContactServer/ContactServiceImpl.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.ContactServer/ContactServiceImpl.cs	(revision 13915)
+++ branches/thasling/DistributedGA/DistributedGA.ContactServer/ContactServiceImpl.cs	(revision 13918)
@@ -92,4 +92,5 @@
         DateTime tmp;
         allPeers.TryRemove(pi, out tmp);
+        Console.WriteLine(string.Format("Removed peer {0}:{1} from dictionary because last access was: {2}", pi.IpAddress, pi.Port, tmp));
       }
     }
Index: branches/thasling/DistributedGA/DistributedGA.Core.Host/Program.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core.Host/Program.cs	(revision 13915)
+++ branches/thasling/DistributedGA/DistributedGA.Core.Host/Program.cs	(revision 13918)
@@ -6,73 +6,63 @@
 using DistributedGA.Core.Interface;
 
-namespace DistributedGA.Core.Host
-{
-    class Program
-    {
-        static void Main(string[] args)
-        {
-            try
-            {
-                Console.WriteLine("Starting peer...");
-                string ipPrefix = ConfigurationManager.AppSettings["LanIpPrefix"];
-                string serverUrl = ConfigurationManager.AppSettings["ContactServerURL"];
+namespace DistributedGA.Core.Host {
+  class Program {
+    static void Main(string[] args) {
+      try {
+        Console.WriteLine("Starting peer...");
+        string ipPrefix = ConfigurationManager.AppSettings["LanIpPrefix"];
+        string serverUrl = ConfigurationManager.AppSettings["ContactServerURL"];
 
-                IMessageHandler h = new PeerNetworkMessageHandler();
-                h.Init(ipPrefix, serverUrl);
+        IMessageHandler h = new PeerNetworkMessageHandler();
+        h.Init(ipPrefix, serverUrl);
 
-                PeerInfo pi = h.GetPeerInfo();
-                Console.WriteLine(string.Format("Peer is hostet at IP: {0} and port: {1}", pi.IpAddress, pi.Port));
-                Thread.Sleep(1000 * 20);
-                Console.WriteLine("Current peers within network:");
-                foreach (var item in h.GetCurrentNetwork())
-                {
-                    Console.WriteLine(string.Format("Peer at {0}:{1}", item.IpAddress, item.Port));
-                }
-
-                int i = 0;
-                while (true)
-                {
-                    i++;
-                    Thread.Sleep(1000);
-                    var message = CreateMessage(pi, i);
-                    Console.WriteLine("Publishing messages...");
-                    h.PublishDataToNetwork(message);
-                    Console.WriteLine("Messages published.");
-                    Console.WriteLine("Recieved messages:");
-                    foreach (var item in h.GetDataFromNetwork())
-                    {
-                        Console.WriteLine(string.Format("Message:{0}", GetString(item)));
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                Console.WriteLine(ex.Message);
-                Console.WriteLine("press any key to continue...");
-                Console.ReadLine();
-            }
-
+        PeerInfo pi = h.GetPeerInfo();
+        Console.WriteLine(string.Format("Peer is hostet at IP: {0} and port: {1}", pi.IpAddress, pi.Port));
+        Thread.Sleep(1000 * 20);
+        Console.WriteLine("Current peers within network:");
+        foreach (var item in h.GetCurrentNetwork()) {
+          Console.WriteLine(string.Format("Peer at {0}:{1}", item.IpAddress, item.Port));
         }
 
-        private static byte[][] CreateMessage(PeerInfo pi, int iterationNumber)
-        {
-            string msg1 = string.Concat("Message 1 from Peer ", pi.IpAddress, ":", pi.Port, " at iteration ", iterationNumber);
-            string msg2 = string.Concat("Message 2 from Peer ", pi.IpAddress, ":", pi.Port, " at iteration ", iterationNumber);
-            return new byte[][] { GetBytes(msg1), GetBytes(msg2) };
+        int i = 0;
+        while (i < 20) {
+          i++;
+          Thread.Sleep(1000);
+          var message = CreateMessage(pi, i);
+          Console.WriteLine("Publishing messages...");
+          h.PublishDataToNetwork(message);
+          Console.WriteLine("Messages published.");
+          Console.WriteLine("Recieved messages:");
+          foreach (var item in h.GetDataFromNetwork()) {
+            Console.WriteLine(string.Format("Message:{0}", GetString(item)));
+          }
         }
+        h.Dispose();
+      }
+      catch (Exception ex) {
+        Console.WriteLine(ex.Message);
+        Console.WriteLine("press any key to continue...");
+        Console.ReadLine();
+      }
 
-        static byte[] GetBytes(string str)
-        {
-            byte[] bytes = new byte[str.Length * sizeof(char)];
-            System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
-            return bytes;
-        }
+    }
 
-        static string GetString(byte[] bytes)
-        {
-            char[] chars = new char[bytes.Length / sizeof(char)];
-            System.Buffer.BlockCopy(bytes, 0, chars, 0, bytes.Length);
-            return new string(chars);
-        }
+    private static byte[][] CreateMessage(PeerInfo pi, int iterationNumber) {
+      string msg1 = string.Concat("Message 1 from Peer ", pi.IpAddress, ":", pi.Port, " at iteration ", iterationNumber);
+      string msg2 = string.Concat("Message 2 from Peer ", pi.IpAddress, ":", pi.Port, " at iteration ", iterationNumber);
+      return new byte[][] { GetBytes(msg1), GetBytes(msg2) };
     }
+
+    static byte[] GetBytes(string str) {
+      byte[] bytes = new byte[str.Length * sizeof(char)];
+      System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
+      return bytes;
+    }
+
+    static string GetString(byte[] bytes) {
+      char[] chars = new char[bytes.Length / sizeof(char)];
+      System.Buffer.BlockCopy(bytes, 0, chars, 0, bytes.Length);
+      return new string(chars);
+    }
+  }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs	(revision 13915)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs	(revision 13918)
@@ -45,4 +45,5 @@
                 readQueue = new ConcurrentQueue<byte[]>();
 
+
                 host = new WcfMessageService();
                 ownInstance.Port = host.Init(ownInstance.IpAddress); //getting port, on which service is hostet
@@ -67,4 +68,6 @@
             {
                 host.Dispose();
+                sender.Dispose();
+                peerListManager.Dispose();
             }
             catch (Exception ex)
Index: branches/thasling/DistributedGA/DistributedGA.Core/Implementation/TestPeerListManager.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Implementation/TestPeerListManager.cs	(revision 13915)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Implementation/TestPeerListManager.cs	(revision 13918)
@@ -28,4 +28,10 @@
 
         }
+
+
+        public void Dispose()
+        {
+            
+        }
     }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageSender.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageSender.cs	(revision 13915)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageSender.cs	(revision 13918)
@@ -4,36 +4,30 @@
 using DistributedGA.Core.Interface;
 
-namespace DistributedGA.Core.Implementation
-{
-    public class WcfMessageSender : IMessageSender
-    {
-        private PeerInfo myself;
+namespace DistributedGA.Core.Implementation {
+  public class WcfMessageSender : IMessageSender {
+    private PeerInfo myself;
 
-        public void Init(PeerInfo source)
-        {
-            myself = source;
+    public void Init(PeerInfo source) {
+      myself = source;
+    }
+
+    public void SendData(PeerInfo destination, byte[][] data) {
+
+      var serviceUrl = "DistributedGA.svc";
+      var baseUri = new Uri(string.Concat("net.tcp://", destination.IpAddress, ":", destination.Port, "/DistributedGA"));
+      var serviceUri = new Uri(baseUri, serviceUrl);
+
+      var binding = new NetTcpBinding();
+      var endpoint = new EndpointAddress(serviceUri);
+      using (var myChannelFactory = new ChannelFactory<IMessageContract>(binding, endpoint)) {
+        using (IClientChannel client = (IClientChannel)myChannelFactory.CreateChannel()) {
+          ((IMessageContract)client).SendData(myself, data); //maybe timout exception...
         }
+      }
+    }
 
-        public void SendData(PeerInfo destination, byte[][] data)
-        {
-            var client = CreateServerClient(destination.IpAddress, destination.Port);
-            client.SendData(myself, data); //maybe timout exception...
-        }
-
-        private IMessageContract CreateServerClient(string ip, int port)
-        {
-            var serviceUrl = "DistributedGA.svc";
-            var baseUri = new Uri(string.Concat("net.tcp://", ip, ":", port, "/DistributedGA"));
-            var serviceUri = new Uri(baseUri, serviceUrl);
-
-            var binding = new NetTcpBinding();
-            var endpoint = new EndpointAddress(serviceUri);
-            var myChannelFactory = new ChannelFactory<IMessageContract>(binding, endpoint);
-
-            IMessageContract client = null;
-            client = myChannelFactory.CreateChannel();
-            return client;
-        }
+    public void Dispose() {
 
     }
+  }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs	(revision 13915)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs	(revision 13918)
@@ -97,4 +97,12 @@
         }
 
+
+
+        public void Dispose()
+        {
+            timer.Stop();
+            timer.Dispose();
+            timer = null;
+        }
     }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageSender.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageSender.cs	(revision 13915)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageSender.cs	(revision 13918)
@@ -10,4 +10,6 @@
 
         void SendData(PeerInfo destination, byte[][] data);
+
+        void Dispose();
     }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Interface/IPeerListManager.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Interface/IPeerListManager.cs	(revision 13915)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Interface/IPeerListManager.cs	(revision 13918)
@@ -13,4 +13,6 @@
 
         void SendLogToServer(string msg);
+
+        void Dispose();
     }
 }
