Click here to Skip to main content
11,803,019 members (50,653 online)
Rate this: bad
Please Sign up or sign in to vote.
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 19-Jun-12 21:11pm
Stephen Hewison at 20-Jun-12 4:26am
How are you providing remoting? Via WCF? or an older style web service?
Sandeep Mewara at 20-Jun-12 8:33am
OP replied:
With TCP channel
Member 7966831 at 20-Jun-12 4:33am
With TCP channel
Stephen Hewison at 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)

  Print Answers RSS
0 OriginalGriff 335
1 KrunalRohit 291
2 F-ES Sitecore 270
3 CPallini 270
4 Sergey Alexandrovich Kryukov 234
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,735
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 20 Jun 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100