2010-06-15 61 views
1

我有一个应用程序,我已经运行了4年。昨天他们转移了所有的服务器并安装了大约60个待更新的Windows,现在已经损坏。该应用程序使用远程的更新另一台服务器(10.0.5.230)的一些信息,但是当我尝试创建我的远程对象,我得到以下异常: Error message: No connection could be made because the target machine actively refused it 127.0.0.1:9091 http://img692.imageshack.us/img692/8104/screenshot1ay.png.NET Remoting连接到错误的主机

注意,它正试图连接到127.0 .0.1,而不是正确的服务器。服务器(10.0.5.230)正在监听端口9091,因为它应该。安装此应用程序的所有三台终端服务器上都发生了同样的错误。

这里是所注册的远程对象的代码:

public static void RegisterClient() 
{ 
    string lServer; 

    RegistryKey lKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Shoreline Teleworks\\ShoreWare Client"); 
    if (lKey == null) 
    throw new InvalidOperationException("Could not find Shoretel Call Manager"); 

    object lVal = lKey.GetValue("Server"); 
    if (lVal == null) 
    throw new InvalidOperationException("Shoretel Call Manager did not specify a server name"); 

    lServer = lVal.ToString(); 

    IDictionary props = new Hashtable(); 
    props["port"] = 0; 
    string s = System.Guid.NewGuid().ToString(); 
    props["name"] = s; 
    ChannelServices.RegisterChannel(new TcpClientChannel(props, null), false); 
    RemotingConfiguration.RegisterActivatedClientType(typeof(UpdateClient), 
    "tcp://" + lServer + ":" + S_REMOTING_PORT + "/"); 
    RemotingConfiguration.RegisterActivatedClientType(typeof(Playback), 
    "tcp://" + lServer + ":" + S_REMOTING_PORT + "/"); 
} 

这里是它调用远程对象的代码:

UpdateClient lUpdater = new UpdateClient(Settings.CurrentSettings.Extension.ToString()); 
lUpdater.SetAgentState(false); 

我已验证以下URI传递给RegisterActivatedClientType: “tcp://10.0.5.230:9091 /” 为什么此应用程序尝试连接到错误的服务器?

其他信息:

客户端不连接到服务器:它发出一个ConstructionCall消息发送到服务器并接收回ConstructionResponse。此ConstructionResponse包含引用URI tcp://127.0.0.1:9091的ObjRef。我无法弄清楚这个URI的分配位置。任何想法为什么服务器会返回这个?

回答

1

我发现问题:远程处理服务器有两个网卡启用,其中一个拔掉。禁用未使用的网卡解决了问题。

相关问题