im trying to write a really simple program that
communicates with udp packets between server and client
apps... but i cant receive (or send?) any data from any
of the applications.. what am i doin wrong? here are the
send and receive lines from my program:
Server:
ofcourse this void is in a system.thread and in a loop
---------------------------------------------------------
IPEndPoint endpoint = new IPEndPoint(IPAddress.Any,2000);
try
{
while(true)
{
byte[] x = client.Receive(ref endpoint);
string s = Encoding.ASCII.GetString(x);
status.Text = s;
}
}
catch (Exception e)
{status.Text += e.ToString();}
----------------------------------------------------------
and the client is:
----------------------------------------------------------
UdpClient udpclient = new UdpClient();
IPEndPoint ipend2 = new
IPEndPoint(IPAddress.Parse("127.0.0.1"),2000);
byte[] sendbyte = Encoding.ASCII.GetBytes(textBox1.Text);
try
{
udpclient.Send(sendbyte,sendbyte.Length,ipend2);
}
catch(Exception exc)
{status.Text +=exc.ToString();}
----------------------------------------------------------
so whats wrong ? please help!