Inheritance: Framework.Pipes.IPCSessionBase
コード例 #1
0
        public static async Task CallHandler(byte ipcMessage, Stream ipcMessageData, IPCSession session)
        {
            var message = (IPCMessage)ipcMessage;

            Tuple <MethodInfo, Type> data;

            if (messageHandlers.TryGetValue(message, out data))
            {
                var handlerObj = Activator.CreateInstance(data.Item2, ipcMessage, ipcMessageData) as IPCPacket;

                await Task.Run(() => data.Item1.Invoke(null, new object[] { handlerObj, session }));
            }
            else
            {
                var msgName = Enum.GetName(typeof(IPCMessage), message);

                if (msgName == null)
                {
                    Log.Message(LogTypes.Warning, $"Received unknown ipc message '0x{message:X}'.");
                }
                else
                {
                    Log.Message(LogTypes.Warning, $"Handler for '{msgName} (0x{message:X}) not implemented.");
                }
            }
        }
コード例 #2
0
        public static async Task CallHandler(byte ipcMessage, Stream ipcMessageData, IPCSession session)
        {
            
            var message = (IPCMessage)ipcMessage;

            Tuple<MethodInfo, Type> data;

            if (messageHandlers.TryGetValue(message, out data))
            {
                var handlerObj = Activator.CreateInstance(data.Item2, ipcMessage, ipcMessageData) as IPCPacket;

                await Task.Run(() => data.Item1.Invoke(null, new object[] { handlerObj, session }));
            }
            else
            {
                var msgName = Enum.GetName(typeof(IPCMessage), message);

                if (msgName == null)
                    Log.Message(LogTypes.Warning, $"Received unknown ipc message '0x{message:X}'.");
                else
                    Log.Message(LogTypes.Warning, $"Handler for '{msgName} (0x{message:X}) not implemented.");
            }
        }
コード例 #3
0
 public static void AddConsoleClient(string alias, IPCSession session) => consolePipeClients.Add(alias, session);
コード例 #4
0
 public static void AddConsoleClient(string alias, IPCSession session) => consolePipeClients.Add(alias, session);