Example #1
0
File: core.cs Project: ovg1985/sync
        private void LogResult(TransmitResult result)
        {
            if (result.IsSuccess)
            {
                return;
            }

            StringWriter msg = new StringWriter();

            msg.Write("Operation has failed. Suberrors: \n");
            foreach (var fail in result.Failures)
            {
                msg.Write("* Error {0}\n", fail);
            }

            Log.Error(msg.ToString());
        }
Example #2
0
        public void ExecuteRemoteCommand()
        {
            ReceiveCommand GetCmd           = new ReceiveCommand();
            PacketElements CmdPacketElement = GetCmd.GetCommandPacket();

            Command = CmdPacketElement.ActualCommand;
            IResult             ExecResult    = Execute();
            ResultPacketElement ResultElement = new ResultPacketElement();

            ResultElement.ActualResult = ExecResult;
            ResultElement.Header       = int.Parse(ConfigurationSettings.AppSettings["ResultHeader"]);
            PackResult PackRes = new PackResult();

            PackRes.ResultPacketElements = ResultElement;
            byte[]         ResultPacket = PackRes.ResultPack;
            TransmitResult SendResult   = new TransmitResult();

            SendResult.DataPacket       = ResultPacket;
            SendResult.RemoteSystemName = GetCmd.SenderIP;
            SendResult.SendResult();
        }