.net IPC通道连接通知
我使用 RegisterWellKnownClientType 和 RegisterWellKnownServerType 在 .NET2 中创建了一个 IPC 通道。
先创建服务器还是先创建客户端并不重要 - 一旦它们都运行,它们就会相互连接。
问题是,我发现知道何时建立连接的唯一方法是尝试调用函数,如果没有则捕获异常。
是否有一个事件或我可以连接的东西可以告诉我通道何时连接? 目前在客户端中,我使用计时器来轮询连接。
(顺便说一句,我对使用 WCF 不感兴趣,因为我们陷入了 .NET2)
I've created an IPC channel in .NET2 using RegisterWellKnownClientType and RegisterWellKnownServerType.
It doesnt matter whether the server or client is created first - they'll connect to each other once they're both running.
The problem is that the only way I've found to know when the connection is made, is by trying to call a function, and catching the exception if they're not.
Is there an event or something I can hook up to that will tell me when the channel is connected?
Currently in the client, I use a timer to poll for the connection.
(BTW, i'm not interested in using WCF as we're stuck in .NET2)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论