.NET Remoting - 如何回调所有连接的客户端?

发布于 2024-08-06 14:30:45 字数 302 浏览 3 评论 0原文

我正在研究 .NET 远程处理,我看到一个示例: http://www.mctainsh.com/Articles/Csharp/RemoteCallback.aspx#A%5Fsimple%5Fexample,一切正常。现在我的问题是,如果我尝试启动另一个客户端,服务器不会回调所有连接的客户端,而只会回调最后一个客户端。如何向所有客户发送回调?

I'm studying the .NET Remoting and I see an example on: http://www.mctainsh.com/Articles/Csharp/RemoteCallback.aspx#A%5Fsimple%5Fexample ,all works good. Now my problem is if I try to start another client, server don't callback to all clients connected but only to last one. How can I send callback to all clients?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雪落纷纷 2024-08-13 14:30:45

尝试将这部分代码更改

    public event NotifyCallback Notify
    {
        add    { s_notify = value; }
        remove { /*  */ }
    }

    public event NotifyCallback Notify
    {
        add    { s_notify += value; }
        remove { s_notify -= value; }
    }

:现在,事件未添加到列表中,但 s_notify 设置为在每个 add 上触发不同的事件处理程序。

Try to change this part of code:

    public event NotifyCallback Notify
    {
        add    { s_notify = value; }
        remove { /*  */ }
    }

into:

    public event NotifyCallback Notify
    {
        add    { s_notify += value; }
        remove { s_notify -= value; }
    }

Right now, events are not added to the list, but s_notify is set to fire a different event handler on each add.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文