示例#1
0
        public void ConvertTest()
        {
            CkPacket_DiscoverPDSRequest obj1 = new CkPacket_DiscoverPDSRequest();

            byte[] datagram = obj1.Packet;

            CkPacket_DiscoverPDSRequest obj2 = CkPackets.CreateObject <CkPacket_DiscoverPDSRequest>(datagram);

            Console.WriteLine("Breakpoint Here");
        }
示例#2
0
        public void TestListen()
        {
            UdpClient udpClientSend = new UdpClient("192.168.1.255", 6038);
            UdpClient udpClientRec  = new UdpClient("192.168.255.255", 6038);

            IPEndPoint   remoteIP = new IPEndPoint(IPAddress.Any, 0);
            IAsyncResult ret      = udpClientRec.BeginReceive(null, null);

            byte[] packet = new CkPacket_DiscoverPDSRequest().ToPacket();
            udpClientSend.Send(packet, packet.Length);
            Thread.Sleep(2000);

            byte[] reply = udpClientRec.EndReceive(ret, ref remoteIP);

            Assert.AreEqual(0, 0);
        }