Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a project using remoting with host server and client, I would like to know how can I able only 2 users use the host server at a time and prevent more tries using thraeds.
Posted
Comments
Stephen Hewison 20-Jun-12 4:26am    
How are you providing remoting? Via WCF? or an older style web service?
Sandeep Mewara 20-Jun-12 8:33am    
OP replied:
With TCP channel
Member 7966831 20-Jun-12 4:33am    
With TCP channel
Stephen Hewison 20-Jun-12 4:59am    
Not worked with tcp channel but after a google I can't find information relating to concurrency in its configuration. I would suggest, assuming this is a single process, that you add thread safe code with a usage counter, increment the counter at the entry point on the remote method. Decrement the count on the exit and throw and exception if you're at your desired limit. Although it's much easier with WCF and web services as you can limit users using the concurrency and instancing settings in the configuration or the web gardening settings in IIS.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900