关于Remoting的配置文件

wangjingjing390 2004-03-17 09:15:22
服务器端的配置文件如下
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="HelloServer">
<service>
<wellknown mode="Singleton"
type="HelloLib.Hello,HelloLib"
objectUri="Hi"/>
</service>
<channels>
<channel type="System.Runtime.Remoting.Channels.Tcp.TcpChannel,System.Runtime.Remoting" port="8086"/>
<channel type="System.Runtime.Remoting.Channels.Http.HttpChannel,System.Runtime.Remoting" port="8085"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>

客户端的配置文件如下
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="HelloClient">
<client url="tcp://wjj:8086/HelloServer">
<wellknown type="HelloLib.Hello,HelloLib"
url="tcp://wjj:8086/HelloServer/Hi"/>
</client>
<channels>
<channel type="System.Runtime.Remoting.Channels.Tcp.TcpChannel,System.Runtime.Remoting"/>
<channel type="System.Runtime.Remoting.Channels.Http.HttpChannel,System.Runtime.Remoting"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>

服务器可以正确启动,可是客户端启动抛出异常所Tcp信道已被占用,请问如何解决?
把端口声明更改为
<channel ref="tcp"/>也不行的
另外,请推荐几本关于Remoting方面的好书
...全文
142 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangjingjing390 2004-09-24
  • 打赏
  • 举报
回复
无奈啊
只好揭帖了
marvelstack 2004-03-18
  • 打赏
  • 举报
回复
同一个简单的比较一下,楼主看看是否能帮上你什么忙.
服务器端
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown type="ProcRunner.CProcRunner,ProcRunner" objectUri="ProcRunner" mode="Singleton" />
</service>
<channels>
<channel port="7500" ref="tcp" />
</channels>
</application>
</system.runtime.remoting>
</configuration>

客户端
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown type="ProcRunner.CProcRunner,ProcRunner" url="tcp://localhost:7500/ProcRunner" />
</client>
<channels>
<channel ref="tcp" port="7501" />
</channels>
</application>
</system.runtime.remoting>
</configuration>
huangsuipeng 2004-03-17
  • 打赏
  • 举报
回复
应该是端口的问题,楼主试一下改PORT
其实比较理想的是用IIS作为激活代理,用IIS管理端口的分配
liuyu202 2004-03-17
  • 打赏
  • 举报
回复
学习!
showtimenow 2004-03-17
  • 打赏
  • 举报
回复
自己也没有仔细研究Remoting
不过可以试试把
<channel type="System.Runtime.Remoting.Channels.Tcp.TcpChannel,System.Runtime.Remoting"/>

改为
<channel ref="tcp" port="0" />
试一试
wangjingjing390 2004-03-17
  • 打赏
  • 举报
回复
up
wangjingjing390 2004-03-17
  • 打赏
  • 举报
回复
怎么没有人回答啊?

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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