Пример #1
0
 internal DalamudServer()
 {
     _clients = new ConcurrentDictionary <int, int>();
     _pipe    = new PipeServer <string>("BardMusicPlayer-Grunt-Dalamud");
     _pipe.ClientConnected    += OnConnected;
     _pipe.ClientDisconnected += OnDisconnected;
     _pipe.MessageReceived    += OnMessage;
     _pipe.AllowUsersReadWrite();
     Start();
 }
Пример #2
0
        /// <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);
        }