コード例 #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());
        }
コード例 #2
0
        public bool TrySendPipeMessage(string message)
        {
            var pipeClient = new PipeClient(_pipeName);

            return(pipeClient.SendMessage(message));
        }