Ejemplo n.º 1
0
        private void startWatching()
        {
            try
            {

                log(MOD_NAME, "Starting named pipe server...");
                Server pipeServer = new Server();
                pipeServer.MessageReceived += new Server.MessageReceivedHandler(pipeServer_MessageReceived);

                if (! pipeServer.Running)
                {
                    pipeServer.PipeName = PIPE_NAME;
                    pipeServer.Start();
                    log(MOD_NAME, "server running...");
                }
                else
                    log(MOD_NAME,"Server already running.");

                while (true)
                {
                    try
                    {
                        Thread.Sleep(1000);
                    }
                    catch { }
                }

            }
            catch (Exception e)
            {
                log(MOD_NAME, e.Message);
                log(MOD_NAME, e.StackTrace);
            }
            finally
            {
            }
        }
Ejemplo n.º 2
0
 void pipeServer_MessageReceived(Server.Client client, string message)
 {
     log(MOD_NAME, "From tray: " + message);
 }