“通过线路”触发事件 在.net中
我需要一种方法来“通过线路”触发远程进程上的事件并传递参数(xml 序列化,等等)。 我希望能够做这样的事情。
foreach(childClient c in clientList)
{
MyEvent += c.EventHandler;
}
MyEvent("param");
哪些技术对此有好处? 世界CF?
这是内部软件项目的小型部署,因此设计开销最小是一个优点,不必“快速”并且不会处理大量流量。
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.
foreach(childClient c in clientList)
{
MyEvent += c.EventHandler;
}
MyEvent("param");
what technologies are good for this? 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有多种方法可以实现此目的,但 WCF 是最适合 .NET 代码的方法。 如果您在内部,那么希望防火墙等不会太令人担忧,并且您可以使用全双工的 NET.TCP 绑定。 您想阅读回调合约。
有很多示例,例如这个。
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.
There are a number of examples out there, such as this one.