示例#1
0
文件: Pipes.cs 项目: bencz/OrangeC
        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();
                }
            }
        }
示例#2
0
        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();
                }
            }
        }
示例#3
0
文件: Pipes.cs 项目: bencz/OrangeC
        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)
            {
            }
        }
示例#4
0
        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)
            {
            }
        }