Multi Send : Socket Connection « Network « C# / C Sharp






Multi Send

 

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

public class MultiSend
{
   public static void Main()
   {
      Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
      IPEndPoint iep = new IPEndPoint(IPAddress.Parse("224.100.0.1"), 9050);
      
      byte[] data = Encoding.ASCII.GetBytes("This is a test message");
      server.SendTo(data, iep);
      server.Close();
   }
}

           
         
  








Related examples in the same category

1.new Socket
2.Socket Connect, Send
3.Socket Exception
4.Socket property
5.Creating Socket Connections
6.Thread and socketThread and socket
7.New Multi Send
8.Multi Receive
9.Server Pool
10.SocketPool encapsulates the list of PooledSockets against one specific host, and contains methods for acquiring or returning PooledSockets.