关于remoting的问题,多客户端访问服务器触发线程问题
目的:remoting服务器上跑一个线程(由客户机通过远程对象激活)负责不断通过存储过程扫描数据库,读取某个表的状态值,并将以事件方式触发通知客户端。
实现:仿造C#高级编程callback样例,更改了其远程对象,和配置文件。
问题:好像每个客户端都在服务器上启动了一个线程,而我要得到的效果是通过服务器上一个线程事件通知所有客户端 。这个有可能是实现么?
server.exe.config:
<configuration>
<system.runtime.remoting>
<application name="CallbackSample">
<service>
<wellknown
mode="Singleton"
type="RoomStatusTest.WatchStatus, WatchStatus"
objectUri="CallbackSample"
/>
</service>
<channels>
<channel ref="http" port="6791" >
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>