在WCF客户端 - 服务器通信中,无需调用任何功能即可从服务器向客户端连续发送数据。

在WCF客户端 - 服务器通信中,无需调用任何功能即可从服务器向客户端连续发送数据。

问题描述:

Hi Friend's



当我实现基于WCF的客户端服务器通信时,我遇到了问题。



实际上我根据调用函数进行了通信。



在服务器端我实现了函数,当我们需要得到任何结果时,我调用的函数是客户端。



和我想要的是我想要的套接字编程,我可以在没有调用任何功能的情况下连续发送任何数据。



请帮帮我。提前谢谢。

Hi Friend's

I am getting a problem, when i am implementing WCF based client server communication.

Actually i did Communication based on calling function.

In server side i have implemented function and when we need to get any result than i am calling that function to client.

and what i want is that i want like socket programming in that i can send continuously any data when any data came without invoking any function.

Please help me out. Thank's in advance.

您可以使用事件。但首先,客户端必须订阅服务器的事件。

如果要将数据从服务器发送到客户端,请使用适当的参数引发事件。
You could use events. But at first, the client has to subscribe the events of the server.
When you want to send data from the server to the client, raise the event with appropriate arguments.