I am trying to simulate a Client - Server scenario on my machine in c#. But when i am executing it an exception pops up saying:
No such host is known
My code:
namespace TCPClient
{
public class Program
{
public static void Main(string[] args)
{
UdpClient udpc = new UdpClient(args[0], 2055);
IPEndPoint ep = null;
while (true)
{
Console.Write("Name: ");
string name = Console.ReadLine();
if (name == "") break;
byte[] sdata = Encoding.ASCII.GetBytes(name);
udpc.Send(sdata, sdata.Length);
byte[] rdata = udpc.Receive(ref ep);
string job = Encoding.ASCII.GetString(rdata);
Console.WriteLine(job);
}
}
}
}
I don't understand where I'm going wrong.