UdpClient : UdpClient : Network C# Examples


C# Examples » Network » UdpClient »

 

UdpClient









    
using  System;
using  System.Net;
using  System.Net.Sockets;
using  System.Text;

class  MainClass
{
      public  static  void  Main()
      {
            UdpClient  sock  =  new  UdpClient();
            IPEndPoint  iep  =  new  IPEndPoint(IPAddress.Parse("127.0.0.1"),  9999);
            byte[]  data  =  Encoding.ASCII.GetBytes("This  is  a  test  message");
            sock.Send(data,  data.Length,  iep);
            sock.Close();
      }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Network
» UdpClient