private static void ServerThread(object data) { bool running = true; while (running) { NamedPipeServerStream pipeServer = new NamedPipeServerStream("__MSDN__HELP__PIPE__", PipeDirection.In, 1); try { pipeServer.WaitForConnection(); StreamString ss = new StreamString(pipeServer); string token = ss.ReadString(); if (token == "*stop*") running = false; else StringRequest(token); } catch(Exception) { } finally { pipeServer.Close(); } } }
private static void ServerThread(object data) { bool running = true; while (running) { NamedPipeServerStream pipeServer = new NamedPipeServerStream("__MSDN__HELP__PIPE__", PipeDirection.In, 1); try { pipeServer.WaitForConnection(); StreamString ss = new StreamString(pipeServer); string token = ss.ReadString(); if (token == "*stop*") { running = false; } else { StringRequest(token); } } catch (Exception) { } finally { pipeServer.Close(); } } }
public static void Write(string token) { NamedPipeClientStream pipeClient = new NamedPipeClientStream(".", "__MSDN__HELP__PIPE__", PipeDirection.Out); try { pipeClient.Connect(2000); StreamString ss = new StreamString(pipeClient); ss.WriteString(token); pipeClient.Close(); } catch(Exception) { } }
public static void Write(string token) { NamedPipeClientStream pipeClient = new NamedPipeClientStream(".", "__MSDN__HELP__PIPE__", PipeDirection.Out); try { pipeClient.Connect(2000); StreamString ss = new StreamString(pipeClient); ss.WriteString(token); pipeClient.Close(); } catch (Exception) { } }