Пример #1
0
        public bool SetReceiveServer(Controller controller, string ip, int port)
        {
            WGPacket packet = new WGPacket(0x90);

            packet.SetDevSn(controller.sn);
            var bts = DataHelper.GetIPBytes(ip);

            if (bts == null)
            {
                return(false);
            }
            packet.SetRecieverIPAndPort(bts, port);
            DoSend(packet, controller.ip, controller.port);
            List <WGPacket> packets = WGRecievePacketAddClose(1);

            if (packets.Count == 1)
            {
                return(packets[0].data[0] == 1);
            }
            return(false);
        }