UdpClient.Send : UdpClient « System.Net.Sockets « C# / C Sharp by API






UdpClient.Send

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

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

   
    
  








Related examples in the same category

1.UdpClient.DropMulticastGroup
2.UdpClient.EnableBroadcast
3.UdpClient.JoinMulticastGroup
4.UdpClient.Receive