Exemplo n.º 1
0
        public ClientHostReceive(byte[] data)
        {
            this.clientstatus = new CIPCServer.ClientStatus();
            UDP_PACKETS_CODER.UDP_PACKETS_DECODER dec = new UDP_PACKETS_CODER.UDP_PACKETS_DECODER();
            dec.Source = data;
            if (dec.get_int() == 1)
            {
                this.clientstatus.FPS = dec.get_int();
                switch (dec.get_int())
                {
                case 2:
                    this.clientstatus.Mode = CIPCServer.ClientStatus.MODE.Sender;
                    break;

                case 3:
                    this.clientstatus.Mode = CIPCServer.ClientStatus.MODE.Receiver;
                    break;

                case 4:
                    this.clientstatus.Mode = CIPCServer.ClientStatus.MODE.Both;
                    break;

                case 15:
                    this.clientstatus.Mode = CIPCServer.ClientStatus.MODE.DirectConnect;
                    break;

                default:
                    this.clientstatus.Mode = CIPCServer.ClientStatus.MODE.NoInit;
                    break;
                }
                this.clientstatus.Name = dec.get_string();
            }
        }
 public DirectConnect_NoticePort(CIPCServer.ClientStatus clientstatus)
 {
     this.enc = new UDP_PACKETS_CODER.UDP_PACKETS_ENCODER();
     //OK
     this.enc     += (int)0;
     this.enc     += clientstatus.ReceiverIP;
     this.enc     += clientstatus.ReceiverPort;
     this.enc     += clientstatus.Name;
     this.SendData = this.enc.data;
 }