真正的Wcf双工通信,如何? [英] Real Wcf Duplex Communication ,How?

查看:229
本文介绍了真正的Wcf双工通信,如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我读了一些有关双工通信和使用回调的文章,但我的观察方式始终是这样的:OperationContract中使用的callBacks.因此,当客户端调用OperationContract时,服务会为客户端回呼.
但是我想要相反的情况.服务器发送请求,客户端应回答该请求.
在描述的wcf双工通信中,客户端请求服务,然后服务器使用回调向客户端发送一些通知.但是我希望服务器启动此过程并向客户端发送请求,然后客户端将答案发送到服务器.
现在我的客户每5秒检查一次新请求.
请帮帮我.
谢谢

Hi I read some articles about duplex communication and using callbacks but the way i seen it, it was always like this: callBacks used in a OperationContract. so when a client calls a OperationContract, the service calls back for the client.
but i want the opposite situation. the server sends a request and client should answer it.
in the described wcf duplex communication client requests for a service, and server sends some notification to client using callback. but i want Server start this process and send a request to client,then client answer to server.
now my client checks for new requests every 5 sec.
please help me.
thanks

推荐答案

您也可以在这里阅读(
As you can read also here (http://msdn.microsoft.com/en-us/library/cc645026(v=vs.95).aspx[^]), this functionality depend on the transport protocol you use. Since http uses a tipical request-replay scenario and in most cases the port opened for listening on client side would be inaccessible to the server, you have only this polling mechanism. But if your environment enables you to use WCF over TCP, than you will have a real duplex communication.


这篇关于真正的Wcf双工通信,如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆