コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        public IpcClientService(string pipeName)
        {
            pipeName = pipeName ?? throw new ArgumentNullException(nameof(pipeName));

            PipeClient = new PipeClient <string>(pipeName);
            PipeClient.MessageReceived   += PipeServer_OnMessageReceived;
            PipeClient.ExceptionOccurred += (_, args) => OnExceptionOccurred(args.Exception);
            PipeClient.Connected         += PipeServer_OnConnected;
            PipeClient.Disconnected      += PipeServer_OnDisconnected;

            AsyncDisposables.Add(PipeClient);
        }
コード例 #2
0
ファイル: IpcServerService.cs プロジェクト: H-Core/H.Services
        /// <summary>
        ///
        /// </summary>
        public IpcServerService(string pipeName)
        {
            pipeName = pipeName ?? throw new ArgumentNullException(nameof(pipeName));

            PipeServer = new PipeServer <string>(pipeName);
            PipeServer.MessageReceived    += PipeServer_OnMessageReceived;
            PipeServer.ExceptionOccurred  += (_, args) => OnExceptionOccurred(args.Exception);
            PipeServer.ClientConnected    += PipeServer_OnClientConnected;
            PipeServer.ClientDisconnected += PipeServer_OnClientDisconnected;
            PipeServer.AllowUsersReadWrite();

            AsyncDisposables.Add(PipeServer);
        }