首页 新闻 会员 周边

remoting如何设置客户端调用超时

0
悬赏园豆:50 [已关闭问题]

请问一下,客户端在调用一个远程对象的函数时,怎样设置其超时时间?也就是说,如果远程对象操作时间过长,客户端不准备等待,它该怎么办?
就象是连接数据库超时一样,它总得有一个超时的时间吧,请教客户端该怎样设置其超时时间?
我知道通过编程的方式可以
Hashtable props = new Hashtable();
props["name"] = "tcp_rem";
props["timeout"] = 3000;//设置超时时间
TcpChannel _tcpChannel = new TcpChannel(props, null, null);
ChannelServices.RegisterChannel(_tcpChannel, false);
哪么通过配置文件,如何设置timeout?

一棵芹菜的主页 一棵芹菜 | 初学一级 | 园豆:161
提问于:2008-11-21 11:30
< >
分享
其他回答(1)
0

xuexi le

Jared.Nie | 园豆:1940 (小虾三级) | 2008-11-21 12:16
0
看了你发给我的短消息,我找了一下,不知道用下面这个是否可以解决你的问题

http://support.microsoft.com/kb/821617

<configuration>
<system.runtime.remoting>
<application>
...
<channels>
<channel ref="http">
<formatter ref="soap"/>
<provider ref="propsetter" username="bob" writeToConsole="true">
<endpoint allowAutoRedirect="true"/>
<endpoint preauthenticate="true"/>
<endpoint url="example.com:9000" password="xyz" />
<endpoint url="example.com:9001" password="123" />
<endpoint timeout="10000"/>
</provider>
</channel>
</channels>
...
</application>
</system.runtime.remoting>
</configuration>
eaglet | 园豆:17139 (专家六级) | 2008-11-22 06:18
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册