Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Event Listener Creation

0
0
Thanks for your reply, basically, I want to replicate this sample code on the script side. I did transported the code but I couldn´t get it to work.
    public static void ListenUDP()
    {
        _lst = new UdpClient(4567);
        var groupEp = new IPEndPoint(IPAddress.Any, 4567);          

        try
        {
            while (true)
            {
                Thread.Sleep(50);
                var receiveByteArray = _lst.Receive(ref groupEp);
                ClientIp = groupEp.Address.ToString();
                var receivedData = Encoding.ASCII.GetString(receiveByteArray, 0, receiveByteArray.Length);

                DoSomething(receivedData);
            }
        }
        catch (Exception ex)
        {
            Log.Log.LogError(ex.ToString());
        }
    }

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images