开发者

How do you make a WCF Client asynchronous?

I have a client that sends a reques开发者_开发问答t to a server, and the server answer to him.

I want to do this in an asynchronous way. The client sends a request, the server calculates it and returns it to a service in the client. How can i do this?

p.s. let's say the client wants to do add(int a, int b) and the server needs to send the result to a service that run on the client.


A dual binding is only really needed when the server must send information to the client without a request. Since you are making a request, use one of the more basic bindings.

Making the request asynchronous is all about what the client does when it calls the service. One way of doing this is to get the generated client interface to include the event based asynchronous pattern.

When the client calls this method, it simply returns right away. An event is then triggered when the actual response to the request is received. The server itself is completely uninvolved with how the client waits for the response.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜