How to let wcf service accept only 1 client each time

I have a question about the WCF service, which gives the client the ability to spoil computer files (copy / paste / delete ... etc.).
the service should only accept one client at a time, t accept the client while the other client is already connected, and what configuration does this work? I am using NetTcpBinding.

+4
source share
2 answers

You do not need to do anything, since the default behavior of the service is to make one call at a time. This means that if A calls method X and B also wants to call method X, then request B will not be used until the request is completed.

But if you think that even after the method is executed, no one should access the methods, then you should handle it yourself using Session !!

+2
source

Source: https://habr.com/ru/post/1411742/


All Articles