在远程对像类中设置一个静态变量,在构造函数中++,在析构函数中--.在客户端调用她的时候使用类名.静态变量判断她被实例化多少次。如果超过限制则不实例化,断开连接。Remoting好像使用的是同步长连接,好像无法设置超时。
解决方案 »
- Thread.Sleep()的作用對象到底是誰?
- 怎样传递参数给正在运行的winfrom 程序?
- 3.0的扩展方法引来的沉思……
- 能不能把引用母模版中的一个CONTENT里的字体全部放大哪,最好是可以设置成像素的
- 最近在写 购物车但是碰到了个问题..希望大家帮下
- 怎样实现象Word里那种页面设置,还有页面视图,普通视图???
- 怎样不实例化一个类去调用该类的方法?
- 图片上传问题
- C# 采集
- 没有分给了,帮帮忙,readline 后退一行怎样实现?
- 如果用Excel.dll导出Excel文件,在web.config里面到底该怎么配置?
- 如何设置和判断TCPChannel或者HttpChannel连接超时
IDictionary props = new Hashtable();
props["port"] = 9000;
props["clientConnectionLimit"] = 20;// default value is 2
HttpChannel channel = new HttpChannel(
props,
null,
new BinaryServerFormatterSinkProvider()
);
ChannelServices.RegisterChannel(channel);
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/cpref/html/frlrfsystemruntimeremotingchannelshttphttpchannelclasstopic.htm