I have created a WCF server application, and it's consumed by client. Everything works fine!
The problem is that I need to create a thread for every client that is connected to the server. I have read a lot that the web service create automatically a thread for every client. I tried to connect more clients, and it works.
But I need do create thread manually in my WCF server application.
Well, it is one of the project conditions. Unfortunately, I have no idea how can I do this.
All I know about threads in WCF, is that WCF uses threads from a thread pool to service requests. So when a request begins it draws a thread from this pool to execute the request and after it finishes it returns the thread to the pool.
you need to explain more what / why you are after creating a thread manually and what you are after achieving in the thread so that we can help you better.
As WCF creates a thread on the IIS server for each instance that it recieves.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
In my Server application I host a web service, which it communicates with client successfully(in localhost). WCF manage the communication between client and service, and it creates threads(automatically) for each client request that is connect.
What I need to do, is creating threads manually in my Server application for each client request.
When thread is started, it will encrypt data's(void function for encrypting) and will sent to the client. after this is done, destroy thread.
staticvoid Main(string args)
Uri httpUrl = new Uri("http://localhost:8010/MyService");
ServiceHost host = new ServiceHost(typeof(ClassLibrary1.Communicatio), httpUrl);
//Add a service endpoint
, new WSHttpBinding(), "");
//Enable metadata exchange
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
//Start the Service