'''cs
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
namespace Client
{
class Program
{
static void Main(string[] args)
{
UdpClient client = new UdpClient();
client.JoinMulticastGroup(IPAddress.Parse("239.255.255.250"));
IPEndPoint multicast = new IPEndPoint(IPAddress.Parse("239.255.255.250"), 37020);
string mess = "
byte[] buf = Encoding.Default.GetBytes(mess);
Thread t = new Thread(new ThreadStart(RecvThread));
t.IsBackground = true;
t.Start();
while (true)
{
client.Send(buf, buf.Length, multicast);
Thread.Sleep(1000);
}
}
static void RecvThread()
{
UdpClient client = new UdpClient(37020);
client.JoinMulticastGroup(IPAddress.Parse("239.255.255.250"));
IPEndPoint multicast = new IPEndPoint(IPAddress.Parse("239.255.255.250"),0);
while (true)
{
byte[] buf = client.Receive(ref multicast);
string msg = Encoding.Default.GetString(buf);
Console.WriteLine(msg);
Console.WriteLine(multicast);
}
}
}
}
'''