Home > Net >  WCF, the server-side methods running time is long
WCF, the server-side methods running time is long

Time:03-07

WPF application, use WCF service, the service side, there are two methods:
 
[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:

reference 1st floor tangyanzhi1111 response:
WCF is eliminated, you write a service, also simple very

Is it true? Can also be used in this project? What is alternative products? I can't write, to various protocols a little don't understand,
  •  Tags:  
  • C#