Example #1
0
        void Recv(CKey Key_, EScProto ScProto_, CStream Stream_)
        {
            switch (ScProto_)
            {
            case EScProto.AgentOn:
            {
                var Proto = new SScAgentOn();
                Proto.Push(Stream_);

                _AddAgent(new CKey(Proto.Key), Proto);
            }
            break;

            case EScProto.AgentOff:
            {
                var Proto = new SScAgentOff();
                Proto.Push(Stream_);

                _DelAgent(Proto.Key.PeerNum);
            }
            break;

            case EScProto.ProcOn:
            {
                var Proto = new SScProcOn();
                Proto.Push(Stream_);

                _SetProc(_AgentInfos[Proto.Key.PeerNum], Proto.Proc);
            }
            break;

            case EScProto.ProcOff:
            {
                var Proto = new SScProcOff();
                Proto.Push(Stream_);

                _UnsetProc(_AgentInfos[Proto.Key.PeerNum]);
            }
            break;

            case EScProto.AgentInfos:
            {
                var Proto = new SScAgentInfos();
                Proto.Push(Stream_);

                foreach (var Info in Proto.Infos)
                {
                    if (Info.Proc.Name == "")
                    {
                        _AddAgent(new CKey(Info.Key), Info.Agent);
                    }
                    else
                    {
                        _AddAgent(new CKey(Info.Key), Info.Agent, Info.Proc);
                    }
                }
            }
            break;

            case EScProto.AgentOption:
            {
                var Proto = new SScAgentOption();
                Proto.Push(Stream_);

                var Agent = _AgentInfos[Proto.AgentKey.PeerNum];
                Agent.AgentOption = Proto.Option;
                Agent.Item.SubItems[(Int32)EField.AgentOption].Text = Agent.AgentOption.ToJsonString();
            }
            break;

            case EScProto.AgentStat:
            {
                var Proto = new SScAgentStat();
                Proto.Push(Stream_);

                var Agent = _AgentInfos[Proto.AgentKey.PeerNum];
                Agent.AgentStat[Proto.KeyData.Key] = JsonParser.Parse(Proto.KeyData.Data);
                Agent.Item.SubItems[(Int32)EField.AgentStat].Text = Agent.AgentStat.ToString();
            }
            break;

            case EScProto.ProcStat:
            {
                var Proto = new SScProcStat();
                Proto.Push(Stream_);

                var Agent = _AgentInfos[Proto.AgentKey.PeerNum];
                Agent.ProcStat[Proto.KeyData.Key] = JsonParser.Parse(Proto.KeyData.Data);
                Agent.Item.SubItems[(Int32)EField.ProcStat].Text = Agent.ProcStat.ToString();
            }
            break;

            case EScProto.Notify:
            {
                var Proto = new SScNotify();
                Proto.Push(Stream_);

                tbOutput.AppendText(Proto.Msg);
            }
            break;
            }
        }
Example #2
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(Time);
     Stream_.Push(Point);
     Stream_.Push(Normal);
 }
Example #3
0
 public override void Push(CStream Stream_)
 {
     Stream_.Pop(ref X);
     Stream_.Pop(ref Y);
 }
Example #4
0
 static void Recv(CKey Key_, CStream Stream_)
 {
     Console.WriteLine("Recv:" + Key_.PeerNum.ToString());
 }
Example #5
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(Size);
     Stream_.Push(Offset);
     Stream_.Push(Scale);
 }
Example #6
0
 public override void Push(CStream Stream_)
 {
     Stream_.Pop(ref Name);
     Stream_.Pop(ref Port);
 }
Example #7
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(CountryCode);
     Stream_.Push(MinuteCountOffset);
 }
Example #8
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(NewChildKey);
     Stream_.Push(SessionCode);
 }
Example #9
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(NewChildKey);
 }
Example #10
0
 public override void Push(CStream Stream_)
 {
     base.Push(Stream_);
     Stream_.Pop(ref SessionCode);
     Stream_.Pop(ChildBindNamePort);
 }
Example #11
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(ClientBindNamePortPub);
     Stream_.Push(SessionCode);
     Stream_.Push(NewChildKey);
 }
Example #12
0
 public override void Pop(CStream Stream_)
 {
     base.Pop(Stream_);
     Stream_.Push(ChildCntMax);
     Stream_.Push(ErrorCnt);
 }
Example #13
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(ClientCnt);
     Stream_.Push(ServerCnt);
 }
Example #14
0
 public override void Push(CStream Stream_)
 {
     Stream_.Pop(ref ClientCnt);
     Stream_.Pop(ref ServerCnt);
 }
Example #15
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(Size);
     Stream_.Push(CheckSum);
     Stream_.Push(SendPacketSeq);
 }
Example #16
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(ChildBindNamePort);
     Stream_.Push(SessionCode);
 }
Example #17
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push((SByte)PacketType);
     Stream_.Push(RecvPacketSeq);
 }
Example #18
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(ClientBindNamePortPub);
 }
Example #19
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(Name);
     Stream_.Push(Port);
 }
Example #20
0
 public override void Push(CStream Stream_)
 {
 }
Example #21
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(PeerNum);
     Stream_.Push(PeerCounter);
 }
Example #22
0
 public override void Pop(CStream Stream_)
 {
 }
Example #23
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(Pos);
     Stream_.Push(Dir);
 }
Example #24
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push((Int32)Proto);
 }
Example #25
0
 public override void Push(CStream Stream_)
 {
     Stream_.Pop(ref Time);
     Stream_.Pop(Point);
     Stream_.Pop(Normal);
 }
Example #26
0
 public JsonDataObject Push(string Name_, CStream Data_)
 {
     Add(Name_);
     Push(Data_);
     return(this);
 }
Example #27
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(Y);
 }
Example #28
0
 public override void Push(CStream Stream_)
 {
     Stream_.Pop(ref Size);
     Stream_.Pop(ref CheckSum);
     Stream_.Pop(ref SendPacketSeq);
 }
Example #29
0
 public override void Pop(CStream Stream_)
 {
     Stream_.Push(Point0);
     Stream_.Push(Point1);
 }
Example #30
0
 static void Recv(CKey Key_, CStream Stream_)
 {
     int i = 0;
     Stream_.Pop(ref i);
     Console.WriteLine("Recv:" + Key_.PeerNum + "value:" + i.ToString());
 }