.net Remoting 的简单问题~~~巨分相送,帮顶有分
<system.runtime.remoting>
<application name= "WMSRemoteObject ">
<service>
<wellknown type= "WMSRemoteObject.NotifyPluginReport " objectUri= "WMSRemoteObject.NotifyPluginReport "
mode= "Singleton " />
</service>
<channels>
<channel ref= "tcp " port= "9999 "/>
</channels>
</application>
<application name= "WMSRemoteObject2 ">
.........这样是否可以???????
</application>
</system.runtime.remoting>
服务器在通过配置文件注册通道的时候,如何创建多个通道???多个通道能否公用一个端口??最好给出点注册多个通道的代码~~谢谢啦!!!
[解决办法]
帮顶!
[解决办法]
不懂~
[解决办法]
鼎````````
[解决办法]
<channels>
<channel ref= "tcp " port= "9999 "/>
<channel ref= "http " port= "8888 "/>
</channels>
[解决办法]
服务端注册的时候
你可以把对象比如
WMSRemoteObject.NotifyPluginReport写到代码里面
注册的时候注册不同对像,但是端口使用这一个
[解决办法]
顶
[解决办法]
学习,帮顶!
[解决办法]
<?xml version= "1.0 " encoding= "utf-8 " ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown
mode= "SingleCall "
type= "xxx, xxxx "
objectUri= "xxxxx " />
<wellknown
mode= "SingleCall "
type= "yyy , yyyy "
objectUri= "yyyyy " />
<wellknown
mode= "SingleCall "
type= "zzz, zzzz "
objectUri= "zzzzz " />
<wellknown
mode= "SingleCall "
type= " ... , ..... "
objectUri= ".... " />
</service>
<channels>
<channel port= "8086 " ref= "Tcp "/>
<!--channel port= "8086 " ref= "Http "/-->
</channels>
<!--leaseManagerPollTime= "7S "-->
<lifetime
leaseTime= "7M "
sponsorshipTimeout= "7M "
renewOnCallTime= "7M "
/>
</application>
</system.runtime.remoting>
</configuration>
[解决办法]
问题改改:
多个通道必须用多个端口;不过一个通道可以注册多个对象,可以只使用一个端口。
___________________________________________________________
对.
那如何通过配置文件启用一个单通道多个对象的Server呢?谢谢!
_______________________________________________________
你注册的Server对象就能通过你服务器上开的任何一个通道被访问(客户端决定通过哪个通道访问),配置的时候把多个Server对象都放在 <service> </service> 里边就行,比如:
<system.runtime.remoting>
<application name= "WMSRemoteObject ">
<service>
<wellknown type= "WMSRemoteObject.NotifyPluginReport " objectUri= "WMSRemoteObject.NotifyPluginReport "
mode= "Singleton " />
<wellknown type= "WMSRemoteObject222 " objectUri= "WMSRemoteObject222 "
mode= "Singleton " />
</service>
<channels>
<channel ref= "tcp " port= "9999 "/>
</channels>
</application>
</system.runtime.remoting>
[解决办法]
另外补充,如果LZ用.NET 2.0, 最好在配置通道的时候加上
<formatter ref= "binary " typeFilterLevel= "Full " /> ,
否则会出System.Security.SecurityException 异常.
配置象下边这样:
<system.runtime.remoting>
<application name= "WMSRemoteObject ">
<service>
<wellknown type= "WMSRemoteObject.NotifyPluginReport " objectUri= "WMSRemoteObject.NotifyPluginReport "
mode= "Singleton " />
<wellknown type= "WMSRemoteObject222 " objectUri= "WMSRemoteObject222 "
mode= "Singleton " />
</service>
<channels>
<channel ref= "tcp " port= "9999 "/>
<serverProviders>
<formatter ref= "binary " typeFilterLevel= "Full " />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
[解决办法]
up
[解决办法]
不懂~