开发者

Instance, Session and Concurrency for duplex service

I have a requirement where a service should be sending a message to client every second. There can be only one client to the service.

I have a created a duplex service and now confused on instance, concurrency and session for the service.

  1. Is session always required for a duplex service? SessionMode.Required

  2. Does the InstanceContextMode should always be PerSession. InstanceContextMode = InstanceContextMode.PerSession?

  3. What should be the ConcurrencyMode?

  4. How can I prevent additional client 开发者_如何学Goconnection to the service. Should the callback reference in teh client be static and check for null reference when client request is initially received.

  5. I’ll be implementing a heartbeat operation to check the availablity of the service. Should this be a one-way or request reply call and would this call be in same session?

Thanks.


May be I'm late for a few month... If you have only one client and will not have more clients in future, you can use simplest settings: InstanceContextMode.Singleton, SessionMode.NotAllowed.

About ConcurrencyMode you can read in this tutorial: http://codeidol.com/csharp/wcf/Concurrency-Management/Service-Concurrency-Mode/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜