• λ我爱Aspx >> Asp.Net >> Remoting事件机制续
  • Remoting事件机制续

  • :aspxer  Դ:internet  :2007-5-15 20:46:06  ؼ:
  • (1)关闭一个客户端以后会影响其他的客户端事件

    原因:客户端没有取消事件订阅就关闭了,触发事件的时候找不到事件订阅者

    解决:遍历委托链,找到异常的对象,从委托链中卸下

    (2)服务器端对客户端广播,客户端能收到其他客户端的事件处理信息

    原因:使用了Singleton模式,共享远程对象

    解决:因为需要远程对象有状态且不共享实例,所以只有客户端激活可以选择

    修改后的服务端:

    using System;

    using System.Collections;

    using System.Runtime.Remoting;

    using System.Runtime.Remoting.Channels;

    using System.Runtime.Remoting.Channels.Tcp;

    using System.Runtime.Serialization.Formatters;

    namespace RemoteServer

    {

    class MyServer

    {

    [STAThread]

    static Ҷƪл˵?

  • һƪMicrosoft .NET Remoting:技术概述(二)
    һƪRemoting和Web服务的区别