Thursday 15 January 2015

multithreading - Multithreaded Server implementation in C# -


I am creating a Windows service that has a component that listens to a designated pipe, with programs running from userspace Talks. I have used the code as the basis for multithrred server implementation, although I get a strong code odor from the processnetcloth action that is being called in a tight loop, given below. Is there really no better way to know that in order to open any other stream in the designated pipes, it should be repeated to catch an IOException and try again?

  public void ProcessNextClient (try {try} {Named Pipesverver Stream Pipe Stream = New Named Pipeserve Stream (Pipeline, Pipe Direction.Inte, 254); PipeStream.WaitForConnection (); // Spongze a new pouch for each request and wait Thread T = New thread (ProsecletTrade); T.Start (pipestream); } Catch (exception E) {// If there are no more profit connections (254 is already in use) then keeping looping is to take advantage of just one}}    

Can you move pipes to WCF? When your application code is notified, using an IO closing ports will benefit from an interruption system, when new connections were created in the application.

Take the Pain of Implementing WCF Will also give you the ability to scale if you have more than one pipe with more than one pipe binding to a TCP / HTI binding.

It also shows how you can host the same service on pipes or TCP.

No comments:

Post a Comment