I have a game server (WoW). I want my players to download my custom patches to the game. I\'ve done a program that checks for update/downloading things. I want my program to
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp);
IPAddress serverAddr = IPAddress.Parse("192.168.2.255");
IPEndPoint endPoint = new IPEndPoint(serverAddr, 11000);
string text = "Hello";
byte[] send_buffer = Encoding.ASCII.GetBytes(text );
sock.SendTo(send_buffer , endPoint);
static void SendUdp(int srcPort, string dstIp, int dstPort, byte[] data)
{
using (UdpClient c = new UdpClient(srcPort))
c.Send(data, data.Length, dstIp, dstPort);
}
Usage:
SendUdp(11000, "192.168.2.255", 11000, Encoding.ASCII.GetBytes("Hello!"));