What is a good way to shutdown Threads blocked on NamedPipeServer#WaitForConnection?
问题 I start my application which spawns a number of Threads, each of which creates a NamedPipeServer (.net 3.5 added managed types for Named Pipe IPC) and waits for clients to connect (Blocks). The code functions as intended. private void StartNamedPipeServer() { using (NamedPipeServerStream pipeStream = new NamedPipeServerStream(m_sPipeName, PipeDirection.InOut, m_iMaxInstancesToCreate, PipeTransmissionMode.Message, PipeOptions.None)) { m_pipeServers.Add(pipeStream); while (!m_bShutdownRequested