[ServiceBehavior (InstanceContextMode=InstanceContextMode. Single, ConcurrencyMode=ConcurrencyMode. Multiple)]
Public sealed class WcfNamedPipeService: IWcfNamedPipeService
{
Public bool test1 ()
{
Thread.sleep (10000);//takes 10 seconds
return true;
}
Public bool test2 ()
{
return false;
}
}
Now, the same computer, double drive, two client, the client and the client B into access the server at the same time, the client A call test1 method, client B call test2 method, the result is both the client needs to wait for 10 seconds to get the return value, but the client B should get A return value in an instant, why also to wait 10 seconds?
Don't perform are serial server?
CodePudding user response:
WCF is eliminated, you write a service, also simple
CodePudding user response: