简体   繁体   中英

WCF, Windows service - needs to notify client application

I am a newbie developer to WCF and Windows services. I do know c#. The scenario requires various custom applications running on Windows 7 to call methods in another application. It is a client/server relationship, all running on the same computer. The server must be able to notify each client (one at a time) when a specified condition occurs.

I need to develop the server code only.

Would the following be an acceptable solution:

Make the server a windows service that uses WCF. The server could notify the clients by using a different named pipe for each client ?

Thank you...any suggestions would be appreciated.

Just use duplex communication over tcp/named pipes/msmq/http (WSDualHttpBinding) channel. AFAIK you need two ports (in/out) for duplex over http

I would ditch wcf altogether. Although as Brian says, you can use the duplex bindings, these are complicated at best.

If it's all going to run on the same computer, why do you even need client/server? Just build a single client which does everything you need.

That is a acceptable solution and should work fine.

Other option for consideration (in the spirit of learning) is creating a Routing Service as an intermediary service which spawns the calls to multiple services. So in your scenario, your client would call the routing service and the routing service will in turn call each of your service

The following link should provide more information on routing service...

[Routing Service][1]

http://msdn.microsoft.com/en-us/library/ee517423.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM