100分求Remoting问题

xiangzionest 2004-10-20 05:05:31
我的Remoting服务器端是通过Windows服务实现的,服务器端配置文件为
<configuration>
<system.runtime.remoting>
<application name="RemoteHostService">
<service>
<wellknown type="RemoteObject.ZZCMaintenance, RemoteObject"
objectUri="RemoteObject.ZZCMaintenance" mode="Singleton" />
</service>
<channels>
<channel ref="tcp" port="8085">
<serverProviders>
<formatter ref="binary" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
然后在我们局域网上部署,应用客户端代码:
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
objRemote = (RemoteObject.ZZCMaintenance)Activator.GetObject(typeof(RemoteObject.ZZCMaintenance),"tcp://192.168.1.152:8085/RemoteObject.ZZCMaintenance");
应用成功,没有任何问题,但是当我把windows服务部署到internet上,同时把客户端代码改为:
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
objRemote = (RemoteObject.ZZCMaintenance)Activator.GetObject(typeof(RemoteObject.ZZCMaintenance),"tcp://xxx.xxx.xxx.xxx:8085/RemoteObject.ZZCMaintenance");
,调用出现如下错误:
未处理的“System.Net.Sockets.SocketException”类型的异常出现在 mscorlib.dll 中。

其他信息: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。
是socket超时吗?怎么解决?在线等待,解决立马给分。
...全文
221 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
tvrxk 2004-11-01
  • 打赏
  • 举报
回复
如果是通过InterNet方式运行程序,最好是IIS和配置文件相结合方式,采用http协议,但可以用binnary串行化数据.
Tomgus 2004-10-20
  • 打赏
  • 举报
回复
在internet上还是不要走tcp,用http比较好。
防火墙比较烦
在internet要注意内,外网地址不同!

不过,既然用http,那就用web services吧:)
ermachao 2004-10-20
  • 打赏
  • 举报
回复
楼主采用是否是HTTP的Remoting,如果是当然要有IIS
brightheroes 2004-10-20
  • 打赏
  • 举报
回复
给你推荐一个BLOG,去上面看看REMOTING的文章去
http://www.cnblogs.com/wayfarer
随笔分类里面

BTW:TCP适用局域网,HTTP适用INTENET,这个就不要再置疑了吧
yzx110 2004-10-20
  • 打赏
  • 举报
回复
internet上的服务器的防火墙是不是关闭了那个端口?
xiangzionest 2004-10-20
  • 打赏
  • 举报
回复
服务器上没有运行IIS,可以采用HTTP协议吗?小弟也是刚开始研究,请高手指示
brightheroes 2004-10-20
  • 打赏
  • 举报
回复
Intenet上,还是换HTTP协议看看
你用的是TCP协议
tingpig 2004-10-20
  • 打赏
  • 举报
回复
关注
xiangzionest 2004-10-20
  • 打赏
  • 举报
回复
对,IP和端口确定没有问题,是不是超时问题?
Tomgus 2004-10-20
  • 打赏
  • 举报
回复
ip,端口对吗?

110,538

社区成员

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

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

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