UDP multi-cast : Udp : Network C# Examples


C# Examples » Network » Udp »

 

UDP multi-cast









    
using  System;
using  System.Collections.Generic;
using  System.Collections.Specialized;
using  System.IO;
using  System.IO.Compression;
using  System.Net;
using  System.Net.Mail;
using  System.Net.Sockets;
using  System.Runtime.InteropServices;
using  System.Text;
using  System.Threading;
using  System.Xml;

public  class  MainClass
{
        public  static  void  Main()
        {
                using  (UdpClient  udp  =  new  UdpClient(1024))
                {
                        IPAddress  groupAddress  =  IPAddress.Parse("0.0.0.0");
                        udp.JoinMulticastGroup(groupAddress,  32);
                        udp.EnableBroadcast  =  true;

                        IPEndPoint  sentBy  =  null;
                        byte[]  data  =  udp.Receive(ref  sentBy);
                        udp.DropMulticastGroup(groupAddress);
                }
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Network
» Udp