Beispiel #1
0
        private static void ProcessReceivedScoutingInformation(ScoutResponsePacket packet)
        {
            NetworkDevice device = packet.GetNetworkDevice();

            if (device == null)
            {
                return;
            }


            NetworkDiscoveryEvent?.Invoke(null, new NetworkDiscoveryEventArgs(device));
        }
Beispiel #2
0
        /// <summary>
        /// Sends the information about the device to the endpoint requesting it. Follows a broadcast request
        /// </summary>
        /// <param name="ep"></param>
        private static void SendScoutingInformation(IPEndPoint ep)
        {
            ScoutResponsePacket packet = new ScoutResponsePacket(new NetworkDevice()
            {
                Name = ProgramSettings.DeviceName,
                Type = ProgramSettings.DeviceType
            });



            NetComm.SendByteArray(packet.ToByteArray(), ep);
        }