.NET Remotting 问题 求助:【由于目标机器积极拒绝,无法连接。 127.0.0.1:8089】 如何解决

Maxwills 2009-02-25 08:30:22
生成远程对象的接口:
namespace RemottingObjectInterface
{
public interface IHello
{
string Greeting(string name);
}
}

远程对象:
namespace RemottingObject
{
public class Hello : System.MarshalByRefObject, IHello
{
public Hello()
{
Console.WriteLine("Hello's Constructor is called !");
}

~Hello()
{
Console.WriteLine("Hello's Destructor is called !");
}

public string Greeting(string name)
{
Console.WriteLine("Greeting called !");

return "Hello" + name;
}
}
}

客户端调用代码:
namespace TestClient
{
class Program
{
static void Main(string[] args)
{
//TcpClientChannel channel = new TcpClientChannel();
//ChannelServices.RegisterChannel(channel, false);

//IHello hello = (IHello)Activator.GetObject(typeof(RemottingObjectInterface.IHello), "tcp://localhost:8089/Hi");

RemotingConfiguration.Configure("TestClient.exe.config");

IHello hello = (IHello)Activator.GetObject(typeof(RemottingObjectInterface.IHello), "tcp://localhost:8089/Hi");

Console.WriteLine(hello.Greeting(" - Guoxc"));

}
}
}

服务器端配置文件:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<application>
<service>
<channels>
<channel ref="tcp" port="8089"/>
</channels>
<wellknown type="RemottingObject.Hello,RemottingObject" mode="SingleCall" ObjectUri="Hi">
</wellknown>
</service>
</application>
</configuration>

客户端配置文件:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown type="RemottingObjectInterface.IHello, RemottingObjectInterface"

url="tcp://localhost:8089/Hi" />
</client>
</application>
</system.runtime.remoting>
</configuration>


********问题******************

安装并启动了Windows服务承载远程对象“Hello ”,执行客户程序抛出异常,异常信息为:【由于目标机器积极拒绝,无法连接。 127.0.0.1:8089】
问题出在哪里,请前辈们解决,不胜感激!!
******************************************************
...全文
597 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
talen_lu 2009-02-25
  • 打赏
  • 举报
回复
服务端配置
system.runtime.remoting>
<application name="Service">
<service>
<wellknown type="RemottingObject.Hello,RemottingObject" mode="SingleCall" ObjectUri="Hi">
</wellknown>
</service>

<channels>
<channel ref="tcp" port="8089">
<serverProviders>
<provider ref="wsdl" />
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
<clientProviders>
<formatter ref="binary" />
</clientProviders>
</channel>
</channels>
</application>
<customErrors mode ="Off" />
</system.runtime.remoting>
内容概要:本文提出一种基于鱼鹰优化算法(OOA)优化的CNN-BiGUR-Attention混合模型,用于提升短期风电功率预测的精度与稳定性,采用Matlab实现代码仿真。该模型融合卷积神经网络(CNN)提取输入数据的局部空间特征,利用双向门控循环单元(BiGUR)捕捉风速、功率等时间序列的前后向动态依赖关系,并引入注意力机制自适应强化关键时间步的特征权重,从而增强模型对非平稳风电数据的表征能力;进一步,采用OOA算法对模型超参数进行全局寻优,有效提升模型收敛速度与泛化性能。研究基于实际风电场历史数据开展实验验证,结果表明,该方法相较传统模型在预测精度、鲁棒性和误差抑制方面表现更优,适用于高比例可再生能源接入背景下的电力系统调度需求。; 适合人群:从事新能源发电预测、电力系统优化调度、智能算法与深度学习融合应用等方向的科研人员及工程技术人员,尤其适合具备Matlab编程能力、熟悉时间序列建模与深度学习框架的研究者。; 使用场景及目标:①实现风电场短期功率高精度预测,支撑电网安全稳定调度与能量管理;②为深度学习模型结构设计与智能优化算法联合调参提供实践范例;③推动人工智能技术在可再生能源预测、智能电网运行等领域的落地应用。; 阅读建议:建议结合提供的Matlab代码深入理解CNN-BiGUR-Attention网络架构搭建、注意力机制实现方式及OOA优化流程,重点关注数据预处理、模型训练与参数调优细节,可通过替换不同风电数据集进行对比实验,进一步掌握模型迁移能力与适应性。

1,979

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 其他语言讨论
社区管理员
  • 其他语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧