예제 #1
0
        private async void ListenUdpLoop()
        {
            bool udpListenerActive = true;

            while (udpListenerActive)
            {
                //wait until signal is recieved
                UdpSocketMessageReceivedEventArgs udpMsg = await MessageReceivedUdp();

                IncomingMsg?.Invoke(this, new MsgReceivedEventArgs(udpMsg.RemoteAddress, udpMsg.ByteData, TransportType.UDP));
            }
        }
예제 #2
0
        private async void ListenUdpLoop()
        {
            bool udpListenerActive = true;

            while (udpListenerActive)
            {
                //wait until signal is recieved
                UdpSocketMessageReceivedEventArgs udpMsg = await MessageReceivedUdp();

                if (ca != null)
                {
                    IncomingMsg?.Invoke(this, new MsgReceivedEventArgs(udpMsg.RemoteAddress, udpMsg.ByteData, TransportType.UDP));
                }
                else //catch (System.MissingMethodException e0)
                {
                    IncomingMsg2?.Invoke(this, new MsgReceivedEventArgs(udpMsg.RemoteAddress, udpMsg.ByteData, TransportType.UDP));
                }
                //catch (Exception e)
                //{
                //    throw e;
                //}
            }
        }