WCF 异步 - 如何使用 ManualResetEvent
谁能告诉我如何在异步 wcf 服务中使用“ManualResetEvent”?我有一个控制台应用程序,它调用异步 wcf 服务,我想在“oncomplete”事件完成后关闭控制台应用程序。
如果可能的话请给我提供一个样品。
提前致谢。
Can any one tell me how to use 'ManualResetEvent' in a async wcf service? I have a console application which makes calls to async wcf service and I wanted to close the console app after 'oncomplete' event finishes.
If possible please provide me a sample.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将编写类似以下内容的控制台应用程序:
但是,如果您只是执行单个方法调用,那么最好使其同步。仅当您同时调用多个异步方法时,这才会真正有用。
You'd write your Console App something like the following:
However, if you're just doing a single method call, it's probably better to just make it synchronous. This would only really be beneficial if you're calling multiple asynchronous methods simultaneously.