void NewServerThread(string cachedir) { var t = new Thread(new ParameterizedThreadStart(ConnectionThreadFn)); t.IsBackground = true; serverThreads.Add(t); var nss = new NamedPipeServerStream(MakePipeName(cachedir), PipeDirection.InOut, MaxServerThreads, PipeTransmissionMode.Message, PipeOptions.WriteThrough | PipeOptions.Asynchronous); if (Settings.PipeSecurityEveryone) { var npa = new PipeAccessRule("Everyone", PipeAccessRights.ReadWrite, System.Security.AccessControl.AccessControlType.Allow); var nps = new PipeSecurity(); nps.AddAccessRule(npa); nss.SetAccessControl(nps); } t.Start(nss); Logging.Emit("server thread started"); }