Ejemplo n.º 1
0
        /// <summary>
        ///     Stops the pipe server thread
        /// </summary>
        public void Stop()
        {
            if (_serverThread == null)
            {
                return;
            }

            _aborted = true;
            _serverThread.Abort();

            var client = new PipeClient(_pipeName);

            client.SendMessage("", 10);
            _serverThread = null;

            if (Mutex != null)
            {
                ReleaseMutex();
                Mutex.Close();
            }

            OnServerClosed?.Invoke(this, new EventArgs());
        }
        public bool TrySendPipeMessage(string message)
        {
            var pipeClient = new PipeClient(_pipeName);

            return(pipeClient.SendMessage(message));
        }