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.
Is session always required for a duplex service? SessionMode.Required
Does the InstanceContextMode should always be PerSession. InstanceContextMode = InstanceContextMode.PerSession?
What should be the ConcurrencyMode?
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.
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/
精彩评论