在.net中“通过电线”触发事件

时间:2022-11-04 19:41:11

I need a way to trigger events on remote processes "over the wire" and pass parameters (xml serialization, whatever). I want to be able to do things like this.

我需要一种方法来“通过线路”触发远程进程上的事件并传递参数(xml序列化,无论如何)。我希望能够做到这样的事情。

foreach(childClient c in clientList)
{
    MyEvent += c.EventHandler;
}

MyEvent("param");

what technologies are good for this? WCF?

什么技术对此有好处? WCF?

This is a small deployment in house software project so minimal overhead in design is a plus, doesn't have to be "fast" and won't handle large amounts of traffic.

这是内部软件项目中的一个小型部署,因此设计的最小开销是一个加号,不必“快速”并且不会处理大量流量。

1 个解决方案

#1


There are a number of ways of doing this, but WCF is the best match for .NET code. If you are in-house then hopefully firewalls, etc aren't too much of a concern, and you can use the NET.TCP bindings which are full duplex. You want to read up on callback contracts.

有很多方法可以做到这一点,但WCF是.NET代码的最佳匹配。如果你是在公司内部,那么希望防火墙等不是太过关注,你可以使用全双工的NET.TCP绑定。你想阅读回调合约。

There are a number of examples out there, such as this one.

有很多例子,例如这个例子。

#1


There are a number of ways of doing this, but WCF is the best match for .NET code. If you are in-house then hopefully firewalls, etc aren't too much of a concern, and you can use the NET.TCP bindings which are full duplex. You want to read up on callback contracts.

有很多方法可以做到这一点,但WCF是.NET代码的最佳匹配。如果你是在公司内部,那么希望防火墙等不是太过关注,你可以使用全双工的NET.TCP绑定。你想阅读回调合约。

There are a number of examples out there, such as this one.

有很多例子,例如这个例子。