I have developed a WCF service with following instanceContextMode
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
Now by tracing the service , i came to know that it throws following errors.
• On the first occurrence of error it gives this message: Maximum number of pending connections has been reached.
• On the second occurrence it gives this message : The system hit the limit set for throttle ‘MaxConcurrentConnections’.Limit for this throttle was set to 200.Throttle value can be changed by modifying attribute ‘maxConcurrentSessions’ in service throttle element.
To solve this error i need to set the serviceThrottling.
I want to understand the relationshio between the InstanceContextMode.Single and maxConcurrentSesstions b’coz i’ve set the InstanceContextMode to single then also it is giving me error regarding the MaxConCurrentSessions.
Please guide
Sessions and instancing are two separate things. The confusion often arises because you can use PerSession instancing which creates an instance for each session. However, sessions can exist irrespective of the instancing model
I wrote a couple of blog posts around this
sessions in WCF
instancing and threading
Which should help clarify the relationship