Exemple #1
0
        public void Send()
        {
            var message = (NPRPCMessage <T>)NPMessageFactory.CreateMessage(typeof(T));

            message.Message = Message;
            message.ID      = ID;

            var buffer = message.Serialize();

            SourceClient.Send(buffer);
        }
Exemple #2
0
        public void Process()
        {
            try
            {
                var message = NPMessageFactory.CreateMessage(Type);

                Log.Debug("Dispatching a " + message.GetType().Name);

                message.ID = ID;
                message.Deserialize(Buffer);
                message.Process(_client);
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
            }
        }