Good C#.NET Solution to manage frequent database polling

后端 未结 5 1410
被撕碎了的回忆
被撕碎了的回忆 2021-02-08 06:52

I am currently working on a c# .NET desktop application that will be communicating to a database over the internet via WCF and WCF Data Services. There will be many spots in th

5条回答
  •  深忆病人
    2021-02-08 07:46

    you can define a callback interface in the WCF connection like this:

    [ServiceContract(CallbackContract = typeof(IFooClient))]
    

    As the client initiates the connection the should work through the firewall. The the server can method to register for changes an you can get the callback interface with

    IFooClient client = OperationContext.Current.GetCallbackChannel();
    

    and callback all the clients that are registered on data changes.

提交回复
热议问题