From ae6c3430543ff2a703e91990ecf8ebaba6f76bfa Mon Sep 17 00:00:00 2001 From: EvanCui Date: Wed, 15 Jul 2015 17:51:03 +0800 Subject: [PATCH] Fix a listening ip error --- LinuxCommunicator/LinuxCommunicator.cs | 4 ++-- LinuxCommunicator/WebServer.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LinuxCommunicator/LinuxCommunicator.cs b/LinuxCommunicator/LinuxCommunicator.cs index 6fb1dc6..72f4525 100644 --- a/LinuxCommunicator/LinuxCommunicator.cs +++ b/LinuxCommunicator/LinuxCommunicator.cs @@ -11,6 +11,7 @@ using System.Net; using Microsoft.Hpc.Scheduler.Properties; using System.Xml.Linq; using System.Security.Principal; +using System.Globalization; namespace Microsoft.Hpc.Communicators.LinuxCommunicator { @@ -101,7 +102,6 @@ namespace Microsoft.Hpc.Communicators.LinuxCommunicator } return false; - } public bool Initialize() @@ -453,7 +453,7 @@ namespace Microsoft.Hpc.Communicators.LinuxCommunicator private string GetCallbackUri(string nodeName, string action) { - return string.Format("{0}/api/{1}/{2}", this.server.ListeningUri, nodeName, action); + return string.Format("{0}/api/{1}/{2}", string.Format(CultureInfo.InvariantCulture, WebServer.LinuxCommunicatorUriTemplate, Environment.MachineName), nodeName, action); } public void OnRegisterRequested(RegisterEventArgs registerEventArgs) diff --git a/LinuxCommunicator/WebServer.cs b/LinuxCommunicator/WebServer.cs index b138351..89c1f2c 100644 --- a/LinuxCommunicator/WebServer.cs +++ b/LinuxCommunicator/WebServer.cs @@ -28,7 +28,7 @@ namespace Microsoft.Hpc.Communicators.LinuxCommunicator throw new InvalidOperationException("The current system doesn't have a non-NDMA network"); } - this.ListeningUri = string.Format(LinuxCommunicatorUriTemplate, nonDirectNetIp.ToString()); + this.ListeningUri = string.Format(LinuxCommunicatorUriTemplate, "*"); } public void Dispose()