Index: trunk/sources/HeuristicLab.Grid/ClientForm.cs
===================================================================
--- trunk/sources/HeuristicLab.Grid/ClientForm.cs	(revision 113)
+++ trunk/sources/HeuristicLab.Grid/ClientForm.cs	(revision 114)
@@ -58,5 +58,15 @@
 
     private void startButton_Click(object sender, EventArgs e) {
-      clientUrl = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[0] + ":8002/Grid/Client";
+      //clientUrl = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[0] + ":8002/Grid/Client";
+      string hostname = Dns.GetHostName();
+      IPAddress[] addresses = Dns.GetHostAddresses(hostname);
+
+      // Thanks to Microsoft
+      if (System.Environment.OSVersion.Version.Major >= 6) {
+        clientUrl = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[2] + ":" + clientPort.Text +"/Grid/Client";
+      } else {
+        clientUrl = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[0] + ":" + clientPort.Text +"/Grid/Client";
+      }
+
       clientHost = new ServiceHost(this, new Uri(clientUrl));
       try {
Index: trunk/sources/HeuristicLab.Grid/ClientForm.designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Grid/ClientForm.designer.cs	(revision 113)
+++ trunk/sources/HeuristicLab.Grid/ClientForm.designer.cs	(revision 114)
@@ -51,4 +51,6 @@
       this.statusLabel = new System.Windows.Forms.Label();
       this.statusTextBox = new System.Windows.Forms.TextBox();
+      this.label2 = new System.Windows.Forms.Label();
+      this.clientPort = new System.Windows.Forms.TextBox();
       this.SuspendLayout();
       // 
@@ -66,5 +68,5 @@
       this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
       this.stopButton.Enabled = false;
-      this.stopButton.Location = new System.Drawing.Point(99, 74);
+      this.stopButton.Location = new System.Drawing.Point(99, 87);
       this.stopButton.Name = "stopButton";
       this.stopButton.Size = new System.Drawing.Size(75, 23);
@@ -77,5 +79,5 @@
       // 
       this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-      this.startButton.Location = new System.Drawing.Point(15, 74);
+      this.startButton.Location = new System.Drawing.Point(15, 87);
       this.startButton.Name = "startButton";
       this.startButton.Size = new System.Drawing.Size(75, 23);
@@ -95,5 +97,5 @@
       // 
       this.statusLabel.AutoSize = true;
-      this.statusLabel.Location = new System.Drawing.Point(9, 36);
+      this.statusLabel.Location = new System.Drawing.Point(9, 56);
       this.statusLabel.Name = "statusLabel";
       this.statusLabel.Size = new System.Drawing.Size(67, 13);
@@ -103,5 +105,5 @@
       // statusTextBox
       // 
-      this.statusTextBox.Location = new System.Drawing.Point(96, 33);
+      this.statusTextBox.Location = new System.Drawing.Point(96, 53);
       this.statusTextBox.Name = "statusTextBox";
       this.statusTextBox.ReadOnly = true;
@@ -109,9 +111,28 @@
       this.statusTextBox.TabIndex = 9;
       // 
+      // label2
+      // 
+      this.label2.AutoSize = true;
+      this.label2.Location = new System.Drawing.Point(9, 32);
+      this.label2.Name = "label2";
+      this.label2.Size = new System.Drawing.Size(57, 13);
+      this.label2.TabIndex = 10;
+      this.label2.Text = "Client port:";
+      // 
+      // clientPort
+      // 
+      this.clientPort.Location = new System.Drawing.Point(96, 29);
+      this.clientPort.Name = "clientPort";
+      this.clientPort.Size = new System.Drawing.Size(222, 20);
+      this.clientPort.TabIndex = 11;
+      this.clientPort.Text = "8002";
+      // 
       // ClientForm
       // 
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.ClientSize = new System.Drawing.Size(330, 109);
+      this.ClientSize = new System.Drawing.Size(330, 122);
+      this.Controls.Add(this.clientPort);
+      this.Controls.Add(this.label2);
       this.Controls.Add(this.statusTextBox);
       this.Controls.Add(this.statusLabel);
@@ -135,4 +156,6 @@
     private System.Windows.Forms.Label statusLabel;
     private System.Windows.Forms.TextBox statusTextBox;
+    private System.Windows.Forms.Label label2;
+    private System.Windows.Forms.TextBox clientPort;
   }
 }
Index: trunk/sources/HeuristicLab.Grid/ServerForm.cs
===================================================================
--- trunk/sources/HeuristicLab.Grid/ServerForm.cs	(revision 113)
+++ trunk/sources/HeuristicLab.Grid/ServerForm.cs	(revision 114)
@@ -43,6 +43,17 @@
     public ServerForm() {
       InitializeComponent();
-      externalAddressTextBox.Text = "net.tcp://"+Dns.GetHostAddresses(Dns.GetHostName())[0]+":8000/Grid/Service";
-      internalAddressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[0] + ":8001/Grid/JobStore";
+
+      // Thanks to Microsoft
+      if (System.Environment.OSVersion.Version.Major >= 6) {
+        externalAddressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[2] + ":8000/Grid/Service";
+      } else {
+        externalAddressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[0] + ":8000/Grid/Service";
+      }
+      if (System.Environment.OSVersion.Version.Major >= 6) {
+        internalAddressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[2] + ":8001/Grid/JobStore";
+      } else {
+        internalAddressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[0] + ":8001/Grid/JobStore";
+      }
+
       jobStore = new EngineStore();
       server = new GridServer(jobStore);
